You are on page 1of 1

Answers 15-5

10. //Constructor
public Band(int numMembers, int numInstruments, String director, double amount)
{ code}
Band ourBnd = new Band(mem, instrmnts, Mr. Perkins, budget);
What should be the data types of:
D mem
LQW
E instrmnts LQW
F budget
GRXEOH
********************************************************
public class BibleStory
{
public int var1;
public double var2;
public String sss;
public void Samson(double zorro)
{ some code}
public String getDelilah( )
{ some code}
public BibleStory(String x, int y, double z)
{ some code }
}
11. From the %LEOH6WRU\ class above, write the signature of the constructor.
SXEOLF%LEOH6WRU\ 6WULQJ[LQW\GRXEOH] 
12. From the %LEOH6WRU\ class above, what is/are the instance field(s).
YDUYDUVVV
13. From the %LEOH6WRU\ class above, write the signature(s) of the all the method(s).
SXEOLFYRLG6DPVRQ GRXEOH]RUUR 
SXEOLF6WULQJJHW'HOLOLDK  
14. Write code that instantiateV an object called SKLOLVWLQH from the %LEOH6WRU\ class. Pass
the following parameters to the constructor:
The integer should be 19, the String should be Ralph, and the GRXEOH should be
24.18
%LEOH6WRU\SKLOLVWLQH QHZ%LEOH6WRU\ 5DOSK 
15. Assume an object called JUDY\ has been created from the %LEOH6WRU\ class. Write code
that will set the state variable YDU to 106.9 for the JUDY\ object.
JUDY\YDU 
16. Write code that will print the value of the %LEOH6WRU\ data member, VVV. Assume you
have already created an object called EDUW.
6\VWHPRXWSULQWOQ EDUWVVV 

You might also like