Question: In Java, how do I set up an object named chairobj and call set / get methods? ( Starting after Inside the main ( )

In Java, how do I set up an object named chairobj and call set/get methods? ( Starting after "Inside the main() method in the instructions" )
public class GameChair i
static boolean dosubmit = false; // DO NOT MOVE
static string userinput =""; // DO NOT MOVE
// DECitare Your non-Static globai variabies here
private string description2= "GTracing Blue";
private int id2=1962;
private double prodprice =149.99;
public static void main(string [] args)(
SubmitProject1.start(427); // DO NOT /Move
// Insert code for main here
// declare and create an JCT
GameChair chairobj = new GameChair();
chairobj.setdescription2(userinput);
chairobj.setid2(0);
chairobj . setprodprice (0);
// assign values to the 3 object variables by calling SET methods|
System.out.println("Enter a string value for description2");
system.out.println("Enter an int value for id2");
System.out.println("Enter a double value for prodprice");
// print values of the 3 object variables by calling GET methods
System.out.print1n("Method getdescription2 returns"+ chairobj.getdescription2());
System.out.println("Method getid2 returns"+ chairobj.getid2());
System.out.println("Method getprodprice2 returns"+ chairobj.getprodprice());
// DO NOT TOUCH/MOVE
SubmitProject1.locals("chairobj", chairobj);
SubmitProject1.end(705); // DO NOT TOUCH/MOVE
}// end of main
// Write 3 'GET' methods here
public string getdescription2()(
return description2;
public int getid2()(
return id2;
public double getprodprice()(
return prodprice; }
// Write 3 'SET' methods here
public void setdescription2(String a)(
description2{:=ai}
public void setid2(int b)(
id {:2=bi}
public void setprodprice (double c) f
prodprice =c;
}// end GameChair class
 In Java, how do I set up an object named chairobj

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 Databases Questions!