|
Develop a program to implement the concept of interface,
with variables and methods.
Program: interface Sample { void show(); int a=10; } class ABC implements Sample { public void show() { System.out.println("Show method called" + a); } } class Demo190 { public static void main(String args[]) { ABC ob=new ABC(); ob.show(); System.out.println("with class name "+ABC.a); } } |
|
See also Do you have a Java Problem?Ask It in The Java Forum Java Books
Return to : Java Programming Hints and Tips All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|