2 small tasks

Programming
Tutor: None Selected Time limit: 2 Days

TASK 1:

Create four new classes for each real-world object. For each new class that you have created, create an interface that defines its behavior, then require your class to implement it. Omit one or two methods and try compiling. What does the error look like?

TASK 2:

Create a small program that defines some fields. Try creating some illegal field names and see what kind of error the compiler produces.

In the program you created, try leaving the fields uninitialized and print out their values. Try the same with a local variable and see what kind of compiler errors you can produce. 


Jul 29th, 2013
I have 4 objects with fields and behaviors given below: but don't know how to attempt this question.

1. Dog
fields are (color breed and age) behaviors are (barking, running and wagging tail)

2. Car
fields are (gear, speed, cadence) behaviors are (changing gear, applying brakes and changing cadence)

3. Alarm Clock
fields are (current time, Alarm volume and Alarm) behaviors are (time correct or not, increasing alarm volume, decreasing alarm volume, turn alarm on and turn alarm off)

4. Radio
fields are (on, off and current station) behaviors are (turn on, turn off, scan, change station and seek)

Start by going through the Oracle Java tutorials. You'll find everything you need to know in the first few lessons.


Jul 31st, 2013

Are you studying on the go? Check out our FREE app and post questions on the fly!
Download on the
App Store
...
Jul 29th, 2013
...
Jul 29th, 2013
Dec 5th, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer