What is the best way to convert a String in the format 'January 2, 2010' to a Date in Java? ... = date.getTime(); to convert the date into time....
I want to split the string "004-034556" into two strings by the delimiter "-": part1 = ... to check if the string has '-' in it....
Here is a piece of C++ code that shows some very peculiar behavior. For some reason, sorting ... we needed to calculate this for an unknown array.)...
I got a AsyncTask that is supposed to check the network access to a host name. But the ... splash); return; } main.continueAfterHostCheck(); } }...
Due to the implementation of Java generics, you can't have code like this: public class GenSet<E> { ... But I really don't get what's going on....
In Java, are there clear rules on when to use each of access modifiers, namely the ... making class and interface and dealing with inheritance?...
I am trying to write a simple application that gets updated. For this I need a simple function that ... how to download the file in the first place....
(Disclaimer: There are a ton of questions which arise from people asking about data being null/incorrect when ... ...but it is still null here. Etc....
A ... ...
In Java, arrays don't override toString(), so if you try to print one directly, you get the ... doing that? Here are some example inputs and outputs:...
I'm new to Java EE and I know that something like the following three lines <%= x+1 ... JSP 2 lines, and what is this technique called?...
I want to add JTable into JPanel whose layout is null. JPanel contains other components. I have to add JTable at proper position....
How do you write (and run) a correct micro-benchmark in Java? I'm looking for some ... benchmark measure time/iteration or iterations/time, and why?...
What are raw types in Java, and why do I often hear that they shouldn't be used in new code? What ... we can't use raw types, and how is it better?...
What does ArrayIndexOutOfBoundsException mean and how do I get rid of it? Here is a code sample that triggers the exception:...
I am using the Scanner methods nextInt() and nextLine() for reading input. It looks like this: ... is executed, so that my output looks like this:...
I always thought Java uses pass-by-reference. However, I've seen a blog post that claims ... distinction they're making. What is the explanation?...
I've been using the == operator in my program to compare all my strings so far. However, I ran ... and should it not be used? What's the difference?...
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What ... from causing the program to terminate prematurely?...
2.6k questions
24 answers
34 comments
16.4k users