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>
Extending Interface in Java
/* =========================================================== File Name : ExtendingInterface.java WebSite : http://javaproglang.blogspot.in/ Facebook : https://www.facebook.com/AdvanceJavaProgramming Created By : Bintu Chaudhary =========================================================== */ import java.io.*; interface inter1 { int a = 100; final static int b = 200; } interface inter2 extends inter1 { void show(); } class interclass implements inter2 { public void show() { int c = a + b; System.out.println("Sum="+c); } } class ExtendingInterface { public static void main(String args[]) { interclass obj = new interclass(); obj.show(); } }
Output of "ExtendingInterface.java"
Download Complete Program
-
Read more »
No comments:
Post a Comment
No comments:
Post a Comment