software design and construction

software design and construction

1) Create a single *.java file that contains the code below describing classes A, B and C. Notice that each class has its own Main method. Compile the file. (40 points).

1.a) How many *.class files were generated? What are their names?

1.b) Run all the *.class files and take screen shots of the output.

———————————————————————————————————-

<code><span class="kwd">class</span> A_x000D_
<span class="pun">{</span><span class="kwd">public</span> <span class="kwd">static</span> <span class="kwd">void</span> main<span class="pun">(</span><span class="typ">String</span><span class="pun">[]</span> args<span class="pun">)</span><span class="pun">{</span><span class="typ">System</span><span class="pun">.</span><span class="kwd">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"Testing class A"</span><span class="pun">);</span><span class="pun">}</span> <span class="pun">}</span><span class="kwd">class</span> B_x000D_
<span class="pun">{</span><span class="kwd">public</span> <span class="kwd">static</span> <span class="kwd">void</span> main<span class="pun">(</span><span class="typ">String</span><span class="pun">[]</span> args<span class="pun">)</span><span class="pun">{</span><span class="typ">System</span><span class="pun">.</span><span class="kwd">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"Testing class B"</span><span class="pun">);</span><span class="pun">}</span> <span class="pun">}</span><span class="kwd">class</span> C_x000D_
<span class="pun">{</span><span class="kwd">public</span> <span class="kwd">static</span> <span class="kwd">void</span> main<span class="pun">(</span><span class="typ">String</span><span class="pun">[]</span> args<span class="pun">)</span><span class="pun">{</span><span class="typ">System</span><span class="pun">.</span><span class="kwd">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"Application C entry point"</span><span class="pun">);</span><span class="pun">}</span> <span class="pun">}_x000D_
-----------------------------------------------------------------------------------_x000D_
</span></code>2) We want to change the structure of the application such that it runs from_x000D_
only one of the three classes. In other words, only one class will contain _x000D_
the Main method and the other two classes will not. These other classes will contain methods called something other than Main._x000D_
2.a) Edit the *.java file that contains the description of the three classes to implement the above instructions. Make sure that there is only one method with name Main. The other two methods should have different names._x000D_
2.b) Check the number of *.class files generated when you compile the _x000D_
application. How many did you find?_x000D_
2.c) Execute the application and take a screen shot of the output. Include it in your report._x000D_
2.d) Change the contents of the methods in the three classes to produce _x000D_
different outputs. Compile and run the application. Take a screen shot and _x000D_
include in your report._x000D_
_x000D_
General instructions:_x000D_
Your report should be uploaded in eCampus in MS Word or pdf document formats only. Do Not upload any graphics files in native formats (jpg, png, etc.)_x000D_

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30



Click ORDER NOW..

order custom paper