Problem

Class BasicsAnswer the following questions regarding the following class.a. What are the i...

Class Basics

Answer the following questions regarding the following class.

a. What are the instance variables?


b. Which methods are public and which are private?


c. What is the name of the class?


d. What is the name of an object of this class?


e. Is MyClass.tryMe(); a legal statement?


f. Is MyClass.tryMeToo(); a legal statement?


g. Determine the output.

class MyClass{private int var1, var2;private String var3, var4;static private int count;

   public MyClass()   {        Count++;   }

   private void myMethod()   {        System.out.println("MyMethod");   }

   String tryMe(String x)   {        System.out.println(++ var1);        System.out.println (++ var2 + var1);        System.out.println (var3 + "link " + var4) ; return("tryMe " + x);   }

   static void tryMeToo()   {        for (int j = 0; j

   public static void main(String[] args)   {        MyClass x = new MyClass();        System.out.println(x.tryMe("fi rst try"));        x.tryMeToo(); MyClass y = new MyClass();        x.tryMeToo(); y.tryMeToo();   }}

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 10
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT