"Create a class called compartment which represents the ship compartments with attributes like height, width and breadth.
Take care it should not conflict with the compartment class you have created in Abstract class exercise 2.
To avoid conflict create this class in a new package called com.wipro.automobile.ship
"
Answers
Answered by
1
Answer:
Create a compartment class first.
Next add package mypack; at the top of the class
Next write commad on the console (Open command prompt where the java file is store. To do that go to file explorer and navigate to the javafile. Hold shift + mouse right click and click on open command prompt)
javac -d directory javafilename
Run the file
javac -d . Simple.java
This way your class will be within mypack package. you wont get any conflict.
Explanation:
Similar questions