Why does not the developer have full control over the garbage collector ?
I understand that the role of GC is to automatically manage memory but why even using some method like System.gc is there no guarantee that the GC will run?
...
I was looking at the signature class methods Optional and I did not understand what this <T> means in front of the method return empty() :
public static <T> Optional<T> empty()
It returns a O...
What is the best place to handle an exception and send a message to the system user in a desktop application? In the controller, in the view or elsewhere?
I need to create a Java desktop app, and with this pass several parameters of the type:
java myapp.jar -DB c: \ base.db -user admin -pass admin
Is there an easy way to get these parameters? Something like this:
public static void...
Researching on Object Oriented concepts, I came across the following comparative, Extend (Inheritance) versus Overwritten.
I found the following statement for this comparison:
Extend:
When we include new attributes, methods in a chil...
Why can not I extend classes with private constructor?
Getting the A: classes
public class A {
private A(){}
public static void limao(){}
}
and B:
public class B extends A {
private B(){}
public static void banana()...
According to Java documentation : / p>
The Java compiler generally generates more efficient bytecode from switch statements that use String objects than from chained if-then-else statements.
In my Android project I need to create a table with a listview but the data always comes misaligned. I put each record in my database at a position in an array of strings so I can use it in listview . The method I use to try to alig...
I'm starting studies on enterprise applications, and according to my teacher I'm going to need this java technology and would like to know what JNDI is exactly. If possible I wanted an example of its use.
Reading a book about the Java language, I came across some operators that I had never seen before. They are: >> , << , >>= , <<= , >>> , <<< , >>>= and...