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 setget 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 nonStatic globai variabies here
private string description "GTracing Blue";
private int ;
private double prodprice ;
public static void mainstring args
SubmitProjectstart; DO NOT Move
Insert code for main here
declare and create an JCT
GameChair chairobj new GameChair;
chairobj.setdescriptionuserinput;
chairobj.setid;
chairobj setprodprice ;
assign values to the object variables by calling SET methods
System.out.printlnEnter a string value for description;
system.out.printlnEnter an int value for id;
System.out.printlnEnter a double value for prodprice";
print values of the object variables by calling GET methods
System.out.printnMethod getdescription returns" chairobj.getdescription;
System.out.printlnMethod getid returns" chairobj.getid;
System.out.printlnMethod getprodprice returns" chairobj.getprodprice;
DO NOT TOUCHMOVE
SubmitProjectlocalschairobj chairobj;
SubmitProjectend; DO NOT TOUCHMOVE
end of main
Write 'GET' methods here
public string getdescription
return description;
public int getid
return id;
public double getprodprice
return prodprice;
Write 'SET' methods here
public void setdescriptionString a
description:
public void setidint b
id :
public void setprodprice double c f
prodprice ;
end GameChair class
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
