Secret - System.out.println("This is...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
class Secret { private String name; private int age; private int weight; private double height; Secret() { name = ""; age = 0; weight = 0; height = 0; } Secret(String a, int b, int c, double d ) { name = a; age = b; weight = c; height = d; } public void setName(int n) { name = n; } public String getName(int n) { return name; } public void setAge(int a) { age = a; } public int getAge(int a) { return age; } public void setWeight(int w) { weight = w; } public int getWeight(int w) { return weight; } public void setHeight(double h) { height = h; } public double getHeight(double h) { return height; } Secret one = new Secret(); Secret two = new Secret("Jamel", 20, 165, 6);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: System.out.println("This is constructor1:Name = " + one.getName()); System.out.println("This is constructor1:Age = " + one.getAge()); System.out.println("This is constructor1:Weight = " + one.getWeight()); System.out.println("This is constructor1:Height = " + one.getHeight()); System.out.println("This is constructor2:Name = " + two.getName()); System.out.println("This is constructor2:Age = " + two.getAge()); System.out.println("This is constructor2:Weight = " + two.getWeight()); System.out.println("This is constructor2:Height = " + two.getHeight()); }...
View Full Document

This note was uploaded on 10/04/2010 for the course COMPUTER S 106 taught by Professor Moore during the Spring '08 term at Clark Atlanta.

Page1 / 2

Secret - System.out.println("This is...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online