Easy Learning Java (2 Edition): Java for Beginner's Guide Learn easy and fast by Yang Hu

Easy Learning Java (2 Edition): Java for Beginner's Guide Learn easy and fast by Yang Hu

Author:Yang Hu [Hu, Yang]
Language: eng
Format: azw3
Published: 2020-04-05T16:00:00+00:00


public Son(String name) {

super ();

this .name = name;

}

//The son fulfills the requirement of his father to buy fruit

public void buy(String fruit) {

this .fruit = fruit;

}

public String getName() {

return this .name ;

}

}

public class TestAbstract {

public static void main(String[] args) {

Son s = new Son("Luke" );

s.buy("Fruit" );

System.out .println("Dad, Dad, I bought a pound: " + s.getFruit());

}

}

/**

1. The abstract method can't have the implementation, only the declaration



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.