Jump to content

Java - How identify and print a class name in java file received as input


ansarise

Recommended Posts

  • 1 month later...
String fileContents = null;File file = new File("javafile.java");FileInputReader fis = new FileInputReader(file);BufferedInputStream bis = new BufferedInputStream(fis);DataInputStream dis = new DataInputStream(bis);while(dis.available() != 0)   fileContents += dis.readLine();

This is how you can read a file. How you decide to parse the information is up to your algorithm.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...