Responsive Ads Here

Monday, May 4, 2015

JAVA - Override

JAVA - Override

 

public class main extends A{
public static void main(String[] args) {
main obj = new main();
}    
public main()
{
    printinfo();
}
    @Override
        public void printinfo() {
            super.printinfo();
            System.out.println("HI");
        }
}


 
public class A {
    
        int w=10;
        public void printinfo()
        {
            System.out.println("super class  "+w);
        }
}

No comments:

Post a Comment

php4

<?php    // Start the session  session_start();  ?>  <!DOCTYPE html>  <html>  <head>       <link rel=&q...