The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled PHP Code
Posted by: cray | October 26, 2010 @ 8:05pm
PHP Code
[
Download
]
//dog class public class Dog{ private String name; private int ownerID; private String breed; private double age; private double weight; public Dog(String name, int ownerID, String breed, double age, double weight) { this.name = name; this.ownerID = ownerID; this.breed = breed; this.age = age; this.weight = weight; } //set methods public void setName(String name){ this.name = name; } public void setOwnerID(int ownerID){ this.ownerID = ownerID; } public void setBreed(String breed){ this.breed = breed; } public void setAge(double age){ this.age = age; } public void setWeight(double weight){ this.weight = weight; } //print methods public void printName(){ System.out.println("Dog name: " + name); } public void printOwnerID(){ System.out.println("Owner ID: " + ownerID); } public void printBreed(){ System.out.println("Dog breed: " + breed); } public void printAge(){ System.out.println("Dog age: " + age); } public void printWeight(){ System.out.println("Dog weight: " + weight); } public void printAll(){ printName(); printOwnerID(); printBreed(); printAge(); printWeight(); System.out.println(""); } }
Syntax Highlighting
[
Open in new window
]
Author Comments
2/2
Rating
4.47 / 8
34 Votes
http://codebin.yi.org/914
page generated in 0.01 seconds