Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 20756

Java is a high-level, platform-independent, object-oriented programming language originally developed by Sun Microsystems. Java is currently owned by Oracle, which purchased Sun in 2010.

3 votes

Is thıs code efficient always for finding array[max]?

Cleaner implementation of the accepted answer: public static int findMax(int[] array) { // TODO: Take appropriate action if the array is empty. int max_value = Integer.MIN_VALUE; for ( …
Blrfl's user avatar
  • 20.5k
9 votes

Guessing a phone number's country code

Telephone switches can figure this out, so there must be some method to the madness. And, in fact, there is: Country codes are arranged in a tree, where you start at the root and descend into a subt …
Blrfl's user avatar
  • 20.5k
2 votes

Which part of the Memory is used for the Garbage Collector?

Because Java was designed around the idea of having a virtual machine, there really isn't a single, correct answer for this question. … As long as the JVM implements something that appears to the Java program as a heap, all is good. …
Blrfl's user avatar
  • 20.5k
2 votes

Is it conventional to name final/constant local variables in UPPER_SNAKE_CASE?

Constants are things given values that are known before or during compilation. What you've declared is a variable because its value is determined at runtime by invoking a method. The fact that it's …
Blrfl's user avatar
  • 20.5k
3 votes

Multiple threads and single output source

What you'd need for a problem like this is a sliding window to hold your output. Lines are sequentially passed to your threads to be processed and, at the same time, assigned a same-numbered slot in …
Blrfl's user avatar
  • 20.5k
2 votes

Why didn't == operator string value comparison make it to Java?

Java doesn't support operator overloading, which means == only applies to primitive types or references. Anything else requires invocation of a method. …
Blrfl's user avatar
  • 20.5k
52 votes

My Dad is impatient with the pace of my learning to program. What do I do?

He bought me them because I told him programming was fun and I wanted to learn it. ... What should I tell him? "Dad, your approach to this is making learning to program absolutely no fun. Kno …
21 votes

How to communicate that insertion order matters in a map?

You're fighting three things: First is Java's container library. Nothing in its taxonomy gives you a way to determine whether or not the class iterates in a predictable order. There's no IteratesIn …
Blrfl's user avatar
  • 20.5k
38 votes

Why Java does not allow function definitions to be present outside of the class?

The difference between C++ and Java is in what the languages consider their smallest unit of linkage. … If you haven't figured it out already, all of this safety comes with a tradeoff: anything you link to a Java program has to be Java. …
Blrfl's user avatar
  • 20.5k
2 votes

How important is it to learn makefiles?

Being able to successfully use make or something like it lets you check the "understands how to model the dependencies between parts of a program composed of more than one module" box.
Blrfl's user avatar
  • 20.5k
8 votes
Accepted

Separate Thread Pools for I/O and CPU Tasks

To improve efficiency, I wanted to have one thread pool perform the I/O section and have it pass tasks to another thread pool that performs the CPU section. That way, it's unlikely that all threads …
Blrfl's user avatar
  • 20.5k
1 vote

How many threads should I use in my NIO server?

One of the things that's critical in designing a multithreaded system is figuring out how to split the work up in a way that keeps as many cores as busy as possible. Your proposed design uses two typ …
Blrfl's user avatar
  • 20.5k
13 votes
Accepted

What does "TILT" mean in a comment?

Physical pinball machines have sensors in them that detect when something outside is trying to exert too much influence the path of the ball by nudging or tilting the machine. (I say too much here be …
Blrfl's user avatar
  • 20.5k
1 vote

Prefer class members or passing arguments between internal methods?

Do people prefer having this defined as a member variable for the class or passing it as an argument to each of the methods - and why? If I understand what you're asking: The methods in a clas …
Blrfl's user avatar
  • 20.5k