About 50 results
Open links in new tab
  1. java - How do I create a file and write to it? - Stack Overflow

    Java NIO If you already have the content you want to write to the file (and not generated on the fly), the java.nio.file.Files addition in Java 7 as part of Java NIO provides the simplest and most efficient way …

  2. Reading a plain text file in Java - Stack Overflow

    It seems there are different ways to read and write data of files in Java. I want to read ASCII data from a file. What are the possible ways and their differences?

  3. How to read json file into java with simple JSON library

    Jun 7, 2012 · The whole file is a array and there are objects and another array (cars) in the whole array of the file. But i dont know how I can parse the whole array into a java array.

  4. How do I save a String to a text file using Java? - Stack Overflow

    Jun 28, 2009 · In Java, I have text from a text field in a String variable called "text". How can I save the contents of the "text" variable to a file?

  5. How do I create a Java string from the contents of a file?

    Java 7 added a convenience method to read a file as lines of text, represented as a List<String>. This approach is "lossy" because the line separators are stripped from the end of each line.

  6. java - How to run a JAR file - Stack Overflow

    Dec 4, 2016 · java -jar Predit.jar It raised "Failed to load main class" exceptions. So I extracted this JAR file:

  7. How do I get the file extension of a file in Java? - Stack Overflow

    Aug 26, 2010 · Now you need to write platform dependent code. The Java frameworks should be more forward thinking and have APIs for getting extensions where they write the platform dependent code …

  8. java - How do I load a file from resource folder? - Stack Overflow

    Read File as java.io.File Alternatively, if you need an instance of java.io.File, you can employ the getResource() method to retrieve the resource as a URL, and create a File from the resource's path …

  9. Java says FileNotFoundException but file exists

    Scanner scores = new Scanner(new File("scores.dat")); However, this throws a FileNotFoundException, but I have checked over and over again to see if the file exists in the current folder, and after that, I …

  10. java - .war vs .ear file - Stack Overflow

    Oct 20, 2009 · Java Application Servers allow deployment of standalone web modules in a WAR file, though internally, they create EAR files as a wrapper around WAR files. Standalone web containers …