About 10,700,000 results
Open links in new tab
  1. How do I run a Java program from the command line on Windows?

    Apr 22, 2013 · I'm trying to execute a Java program from the command line in Windows. Here is my code: import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; …

  2. Should I use java.util.Date or switch to java.time.LocalDate?

    With Java 8, a new time API was introduced, namely the java.time.LocalDate etc., but java.util.Date is not marked as deprecated. I am writing a new project, which does not need to …

  3. How do I generate random integers within a specific range in Java ...

    Java 7+ In Java 1.7 or later, the standard way to do this (generate a basic non-cryptographically secure random integer in the range ) is as follows:

  4. boolean operations - How to use 'or' in Java? - Stack Overflow

    The || operator can only be used, in Java, where a boolean (true or false) expression is expected, such as in an if statement like the above. So pretty much in an if or a conditional operator (that …

  5. How to set specific Java version to Maven? - Stack Overflow

    Oct 29, 2013 · 268 Maven uses the JAVA_HOME parameter to find which Java version it is supposed to run. I see from your comment that you can't change that in the configuration. You …

  6. How to set the environment variables for Java in Windows

    I anecdotally noticed that the links in that directory didn't get updated during an JDK installation update. So it's best to remove C:\ProgramData\Oracle\Java\javapath; from the Path system …

  7. java - When should I use "this" in a class? - Stack Overflow

    Mar 10, 2010 · But I do not know when I really need to use it. For example, will be there any difference if I use x instead of this.x in some of the methods? May be x will refer to a variable …

  8. properties - How to use Java property files? - Stack Overflow

    Use theses classes located at java.util package => Properties, ListResourceBundle, ResourceBundle classes. To read properties, use iterator or enumerator or direct methods of …

  9. modulo - What's the syntax for mod in Java? - Stack Overflow

    12 Java actually has no modulo operator the way C does. % in Java is a remainder operator. On positive integers, it works exactly like modulo, but it works differently on negative integers and, …

  10. java - How do I tell Gradle to use specific JDK version ... - Stack ...

    JAVA_HOME_FOR_MY_PROJECT=<path to my desired JDK> What I don't want point JAVA_HOME to the desired JDK I could live with many suggestions: a solution that defines a …