Question: I. Give the programs below: public class ClassAClient public static void main ( String [ ] args ) { ClassA A 1 = new ClassA

I. Give the programs below:
public class ClassAClient
public static void main(String[] args){
ClassA A1= new ClassA O;
System.out.println(A1.getxy());
A1. setx(7);
A1.sety(20);
System.out.println(A1.getxy());
System.out.println("The End");
}}
//without public modify, two classes can be in the same file
class ClassA {
private int x=9;
private int y=4;
public ClassA (){}
public void setx (int x 1)
x=x1;
I. Give the programs below: public class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!