Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

package com.CITC1318.course; public class GreetingsClass { public static void main(String[] args) { System.out.println($ Greetings, CITC1318!); } } This exercise will have you compiling and running

package com.CITC1318.course;

public class GreetingsClass {

public static void main(String[] args) {

System.out.println("$ Greetings, CITC1318!");

} }

This exercise will have you compiling and running the application with new classes created in a separate package:

1. Compile the program: c:\Code>javac -d . GreetingsClass.java

2. Run the program to ensure it is error-free:

c:\Code>java -cp . com.CITC1318.course.GreetingsClass

3. Create three classes named Chapter1, Chapter2, and Chapter3 that are placed in the com.CITC1318.course.Chapters package. Create constructors that will print the names of the chapters to standard out.

package com.CITC1318.course.Chapters;

public class Chapter1 {

public Chapter1(){

System.out.println("Hello from Chapter1!");

} }

4. Instantiate each class from the main program, by adding the necessary code to the GreetingsClass class. Here is how to instantiate the object c1 from the class Chapter1:

Chapter1 c1 = new Chapter1();

do a c2 from the class Chapter2 and c3 from the class Chapter3.

5. Ensure that all of the class code arein the paths

code\com\CITC1318\courseand code\com\CITC1318\course\Chapters

6. Determine the command-line arguments needed to compile the complete program. Compile the complete program, and debug where necessary.

7. Determine the command-line arguments needed to execute the program. Make sure to update the text file in

The standard output will read as follows:

$ Greetings, CITC1318!

Hello from Chapter1!

Hello from Chapter2!

Hello from Chapter3!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java How To Program Early Objects

Authors: Paul Deitel, Harvey Deitel

11th Edition

9780134743356

More Books

Students also viewed these Programming questions

Question

Define Management or What is Management?

Answered: 1 week ago

Question

What do you understand by MBO?

Answered: 1 week ago

Question

What is meant by planning or define planning?

Answered: 1 week ago

Question

Define span of management or define span of control ?

Answered: 1 week ago

Question

Difference between truncate & delete

Answered: 1 week ago