questions/java/page/25
Use the following program public class Osname { public ...READ MORE
Using braces makes the code more maintainable ...READ MORE
Use java.lang.String.format() method. String.format("%05d", number ...READ MORE
Till you send the code, I would ...READ MORE
Scanner in = new Scanner(System.in); int i = ...READ MORE
Thread.currentThread().getStackTrace() will usually contain the method you’re ...READ MORE
import java.util.Arrays; public class Sort { ...READ MORE
The following code will work fine. But I ...READ MORE
If you are using Java 1.5 or ...READ MORE
This is also a way to work ...READ MORE
We parse the full date to time ...READ MORE
Here's a good way to create a memory ...READ MORE
I want to populate the data coming ...READ MORE
Can’t tell you the exact reason as ...READ MORE
You can use Scanner class to read ...READ MORE
import java.util.Arrays; import java.util.Collections; import org.apache.commons.lang.ArrayUtils; public class MinMaxValue { ...READ MORE
public class GenericClass<T> { ...READ MORE
One can use the given method to ...READ MORE
Java assertion feature allows the developer to ...READ MORE
Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, 1); Date date = ...READ MORE
setLoanItem() isn't a static method, it's an instance ...READ MORE
This quote rightly explains that 2 totally ...READ MORE
We can use Apache Commons IO. It ...READ MORE
Actual SETUP: OS: Windows 8.1 JDK file: jdk-8u11-windows-x64.exe ADT file: ...READ MORE
One approach is to use NetworkInterface.getNetworkInterfaces() to get all ...READ MORE
Use a flag, which will indicate the ...READ MORE
If you are working on Desktop Application, ...READ MORE
I found this an efficient way in counting ...READ MORE
Well, none of these is the default ...READ MORE
In order to use JAVA_OPT you need ...READ MORE
public class Test { // ...READ MORE
The MessageDigest class can provide you with an instance ...READ MORE
A daemon thread is a thread that is doing ...READ MORE
InputStream in = this.getClass().getClassLoader().getResourceAsStream("TextFile.txt"); InputStream in = this.getClass().getResourceAsStream("/TextFile.txt"); package ...READ MORE
My guess is that you are trying ...READ MORE
continue is kind of like goto. Are you familiar ...READ MORE
An alternative is to use String.format: double[] arr = ...READ MORE
You can refer the below code: Properties properties ...READ MORE
int[][] multi = new int[5][]; multi[0] = new ...READ MORE
In Java, getter and setter are two ...READ MORE
There are 2 options you can go ...READ MORE
Static block is used for initializing the ...READ MORE
ADD 3 jars found in the following ...READ MORE
This exception is thrown when an application ...READ MORE
Another workaround if you use apache commons-lang: int[] ...READ MORE
Think of reference parameters as being aliases ...READ MORE
You can also use java.nio.file.Path and java.nio.file.Paths. Path ...READ MORE
You can achieve that concisely in Java: Random ...READ MORE
You've got two problems: 1) You're using Collections.sort (which takes ...READ MORE
equals() must define an equivalent relation and ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.