The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 406 Weeks Ago, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Consider the following definition of the class MyClass:


a. Write a Java statement that increments the value of count by 1.
b. Write a Java statement that outputs the value of count.
c. Write the definitions of the methods and the constructors of the class MyClass as described in its definition.
d. Write a Java statement that declares myObject1 to be a MyClass object and initializes its instance variable x to 5.
e. Write a Java statement that declares myObject2 to be a MyClass object and initializes its instance variable x to 7.
f. Which of the following statements are valid? (Assume that myObject1 and myObject2 are as declared in parts d and e.

Assume that myObject1 and myObject2 are as declared in parts d and e. After you have written the definition of the methods of the class MyClass, what is the output of the following Java code?

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll