Question: 2. Develop a class layout tool like the Java's built-in executable file javap to show the skeleton of a class file. The tool can display

 2. Develop a class layout tool like the Java's built-in executable

2. Develop a class layout tool like the Java's built-in executable file "javap to show the skeleton of a class file. The tool can display the fields, methods, exceptions and constructors of a given .class file without source code. The following gives an example. After compiling the following NewClass.java file on the left, the byte code NewClass.class is rendered. Your developed tool can accept NewClass.class as input to show the skeleton on the right. Feel free to run javap ClassName to verify accuracy. Ensure other class files can be processed without an error too. Note that constructors and methods that throw exceptions should also be displayed. This tool will be the building block for the next tool that you are going to build. (6 pts) // This is the original.java code. // This is the skeleton. public class NewClass { public class NewClass { int w, h, d; int w; public static void main(String[] args) { int h; } int d; public void ml(int i, int j, int k){ public NewClass(); } public static void main(java.lang. String[] sa); public int m2(int i) { public void ml(int il, int i2, int i3); return 0; public int m2 (int i); } protected java.lang. Integer m3(double d); protected Integer m3(double d){ } return null; } } 2. Develop a class layout tool like the Java's built-in executable file "javap to show the skeleton of a class file. The tool can display the fields, methods, exceptions and constructors of a given .class file without source code. The following gives an example. After compiling the following NewClass.java file on the left, the byte code NewClass.class is rendered. Your developed tool can accept NewClass.class as input to show the skeleton on the right. Feel free to run javap ClassName to verify accuracy. Ensure other class files can be processed without an error too. Note that constructors and methods that throw exceptions should also be displayed. This tool will be the building block for the next tool that you are going to build. (6 pts) // This is the original.java code. // This is the skeleton. public class NewClass { public class NewClass { int w, h, d; int w; public static void main(String[] args) { int h; } int d; public void ml(int i, int j, int k){ public NewClass(); } public static void main(java.lang. String[] sa); public int m2(int i) { public void ml(int il, int i2, int i3); return 0; public int m2 (int i); } protected java.lang. Integer m3(double d); protected Integer m3(double d){ } return null; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!