Jump to content

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


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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...