ansarise Posted March 26, 2011 Share Posted March 26, 2011 Create java program to read java file and find the number of classes, number of methods in each class and also i want to print the number of lines in each class separately. Print Total number lines in the input Java file also... Link to comment Share on other sites More sharing options...
MrFish Posted May 10, 2011 Share Posted May 10, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.