TestSecret - Secret two = new...

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(String n) { name = n; } public String getName() { return name; } public void setAge(int a) { age = a; } public int getAge() { return age; } public void setWeight(int w) { weight = w; } public int getWeight() { return weight; } public void setHeight(double h) { height = h; } public double getHeight() { return height; }} public class TestSecret { public static void main(String[]args) { Secret one = new Secret();
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: Secret two = new Secret("Jamel", 20, 165, 6); System.out.println("Constructor 1: Name: " + one.getName()); System.out.println("Constructor 1: Age: " + one.getAge()); System.out.println("Constructor 1: Weight: " + one.getWeight()); System.out.println("Constructor 1: Height: " + one.getHeight()); System.out.println("Constructor 2: Name: " + two.getName()); System.out.println("Constructor 2: Age: " + two.getAge()); System.out.println("Constructor 2: Weight: " + two.getWeight()); System.out.println("Constructor 2: 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

TestSecret - Secret two = new...

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