Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Overloading {
- void info(){
- System.out.println("Basic house");
- }
- void info(String name){
- System.out.println("House for "+name);
- }
- void info(String name, int num){
- System.out.println(num+
- " houses for "+name);
- }
- }
- public class Overload{
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Overloading ov = new Overloading();
- ov.info("Ahmad", 2);//method ke-3
- ov.info();//method ke-1
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment