Download EXERCISE 2 FLOW CONTROL

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Smalltalk wikipedia , lookup

Design Patterns wikipedia , lookup

String literal wikipedia , lookup

Falcon (programming language) wikipedia , lookup

Scala (programming language) wikipedia , lookup

Protected mode wikipedia , lookup

Java syntax wikipedia , lookup

Name mangling wikipedia , lookup

Class (computer programming) wikipedia , lookup

Object-oriented programming wikipedia , lookup

C++ wikipedia , lookup

Java (programming language) wikipedia , lookup

Java performance wikipedia , lookup

C Sharp syntax wikipedia , lookup

C Sharp (programming language) wikipedia , lookup

Transcript
CLASS EXERCISE 6,
COMPOSITION/AGGREGATION
1. There is a class Address. The class Address has
instance variables protected String street,
protected String postalCode, and protected
String city. The simplest constructor is the constructor
having three parameters.
The class Name has two instance variables protected
String firstName and protected String
secondName. Again with this class Name build the simplest
constructor possible.
The class Student has an instance variable protected
Name studentsName, which is a reference to Name object
and an instance variable protected Address
studentsAddress which is a reference to Address
object.
Implement an overridden version of the method
toString() into the classes Address, Name, and
Student.
Test your classes by creating an object to the class
Student.
Implement the files Address.java, Name.java, Student.java
and Test.java. The file Test.java includes the main method.
Exercise5.doc
Java Programming
tMyn
Nothing will be returned to the teacher.
Exercise5.doc
Java Programming
tMyn