Answer to Question #211702 in Java | JSP | JSF for Karon Aldrich

Question #211702

In the character class main method, implement code to demonstrate applying the above classes as follows: (a) Declare a Character reference variable and create one of your custom character objects to store in it (b) Create an Item object for use by the character (c) Simulate the character receiving and using the item by calling character class method.

Make UML diagrams for your character class and item class, including fields


1
Expert's answer
2021-06-29T05:52:31-0400


import java.io.*;
class MyClass {
    int a = 40;
    int b = 75;
 
    int display(MyClass m1, MyClass m2)
    {
       
        m1.a = 47;
 
        System.out.println("a = " + a);
 
        System.out.println("b = " + b);
 
        return 0;
    }
}
class Main {
    public static void main(String[] args)
    {
        MyClass m3 = new MyClass();
        MyClass m4 = new MyClass();
 
        m4.b = 112;
 
        m3.display(m3, m4);
 
        m4.display(m3, m4); 
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS