Home
Tutorials
Core Java
Introduction To Java
Java Evolution
Overview of Java
Constants, Variables and Data Types
Java Operators
Branching Statements
Looping Statements
Classes, Objects and Methods
Inheritance
Array, String and Vectors
Java Interfaces
Java Packages
Applet Programming
Graphics Programming
Advanced Java
Java AWT
Java Event Handling
Java File Handling
Java MultiThreading
Java Swing-I
Java Swing-II
Exception Handling
Socket Programming
Java Database
Java RMI
Java Servlets
Java Beans
Programms
Projects
Downloads
Contact
Java Programming
!doctype>
Single Inheritance in Java
/* ======================================================= File Name : SingleInheritance.java WebSite : http://javaproglang.blogspot.in/ Facebook : https://www.facebook.com/bintu.chaudhary.mks Twitter : https://twitter.com/bintuchaudhary Created By : Bintu Chaudhary ======================================================= */ import java.io.*; class A { void show() { System.out.println("\n\tShow the Method of A Class"); } } class B extends A { void display() { System.out.println("\n\tDisplay the Method of B Class"); } } class SingleInheritance { public static void main(String args[]) { B obj=new B(); obj.show(); obj.display(); } }
Output of "SingleInheritance"
Download Complete Program
-
Read more »
No comments:
Post a Comment
No comments:
Post a Comment