Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LizardClass {
- String _name;
- float _weight;
- public LizardClass(String name, float weight) {
- _name = name;
- _weight = weight;
- }
- public String getName() {
- return _name;
- }
- public void setName(String name) {
- _name = name;
- }
- public float getWeight() {
- return _weight;
- }
- public void setWeight(float weight) {
- _weight = weight;
- }
- public static void main(String[] args) {
- final LizardClass joe = new LizardClass("Joe", (float) 100.5);
- System.out.println(joe.getName() + "'s weight is " + joe.getWeight());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement