0
   

Consider the following class

 
 
tanish
 
Reply Tue 20 Jun, 2017 01:10 am
public class IdentifyMyParts {

public static int x = 7;

public int y = 3;

}

What are the class variables?

What are the instance variables?

What is the output from the following code:

IdentifyMyParts a = new IdentifyMyParts();

IdentifyMyParts b = new IdentifyMyParts();

a.y = 5;

b.y = 6;

a.x = 1;

b.x = 2;

System.out.println(“a.y = ” + a.y);

System.out.println(“b.y = ” + b.y);

System.out.println(“a.x = ” + a.x);

System.out.println(“b.x = ” + b.x);

System.out.println(“IdentifyMyParts.x = ” + IdentifyMyParts.x);
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 947 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » Consider the following class
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 05/10/2024 at 07:42:42