Professional Documents
Culture Documents
Delima, Marlon Jr. G. 2BSIT3 SAT 10:00am - 1:00pm Machine Problem 2
Delima, Marlon Jr. G. 2BSIT3 SAT 10:00am - 1:00pm Machine Problem 2
Machine Problem 2
Design a Person Class and use it in a Java Program. Here are the instructions.
* Use Lecture Module 2 as reference.
a) Using the Class Person you designed in Machine Problem 1, add 4 more constructors to your
class. (See examples in Module 2)
c) Create a Main class (class with a main method) to test if your Constructors work properly.
String nationality;
int age;
String gender;
String hairColor;
String skinColor;
public Person(){
nationality="Filipino";
age=21;
gender="male";
hairColor="black";
skinColor="brown";
MAIN METHOD
package Activities;
//ATTRIBUTES
System.out.println("marlonDelima Nationality :
"+marlonDelima.nationality+"\n"
+ "marlonDelima Age:"+marlonDelima.age);
System.out.println("merlyDelima Gender: "+merlyDelima.gender);
System.out.println("glaicyDelima Hair Color:
"+glaicyDelima.hairColor);
System.out.println("hanenDelima Skin Color:
"+hanenDelima.skinColor);
System.out.println();
//BEHAVIOR
marlonDelima.walk();
Marlon.jog();
Marlon.run();
Marlon.eat();
Marlon.sleep();