<< Chapter < Page | Chapter >> Page > |
Write the program described in Listing 21 .
Listing 21 . Listing for Question 21. |
---|
/*File Ap0020f1.java Copyright 2012, R.G.Baldwin
Instructions to student:Beginning with the code fragment shown below, write a
method named doIt that:1. Illustrates the effect of the modulus operation with
doubles.**********************************************************/
public class Ap0020f1{public static void main(String args[]){new Worker().doIt();
}//end main()}//end class definition
//=======================================================//class Worker{
//-----------------------------------------------------////Student: insert the method named doIt between these
// lines.//-----------------------------------------------------//
}//end class definition//=======================================================// |
Write the program described in Listing 22 .
Listing 22 . Listing for Question 22. |
---|
/*File Ap0020g1.java Copyright 2012, R.G.Baldwin
Instructions to student:Beginning with the code fragment shown below, write a
method named doIt that:1. Illustrates the concatenation of the following strings
separated by space characters."This"
"is""fun"
Cause your program to produce the following output:This
isfun
This is fun**********************************************************/
public class Ap0020g1{public static void main(String args[]){new Worker().doIt();
}//end main()}//end class definition
//=======================================================//class Worker{
//-----------------------------------------------------////Student: insert the method named doIt between these
// lines.//-----------------------------------------------------//
}//end class definition//=======================================================// |
I recommend that you open another copy of this document in a separate browser window and use the following links to easilyfind and view the listings while you are reading about them.
This section contains a variety of miscellaneous information.
Notification Switch
Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?