Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class mainClass{
- public static void main(String[] args){
- System.out.println("I am a main class.");
- book sample1 = new book();
- copier sample2 = new copier("This",16,"That");
- copier sample3 = new copier("That",17,"Unknown");
- }
- }
- class copier{
- copier(book b){
- this.book_name = b.book_name;
- this.price = b.price;
- this.type = b.type;
- }
- copier(String name, double price, String type){
- this.name = name;
- }
- }
- class book{
- String book_name="This one";
- double price=16;
- String type="Science";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement