Results 1 to 2 of 2
- 07-08-2012, 08:38 AM #1
Member
- Join Date
- Jul 2012
- Posts
- 1
- Rep Power
- 0
Interface Inheritance : create class that implements the interface
I'm just preparing for my exam. Help me solve this problem.
Java Code:interface J { int j = 200; int j1(); } interface K { double k1(); } interface L extends J,K{ boolean l1(); } class I implements L{ public boolean l1() { return true; } public int j1() { return 4; } public double k1() { return 6.8; } } class InterfaceInheritance{ public static void main(String[] g){ I i=new I(); System.out.println(i.j); System.out.println(i.j1()); System.out.println(i.k1()); System.out.println(i.l1()); } }
Result :
200
4
6.8
true
I just want to learn how to create o class that implements the interface j and k. Then, call the method on a main program in class InterfaceInheritance.
thanks guys for helping me prepare for the exam
- 07-08-2012, 06:23 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,638
- Rep Power
- 13
Re: Interface Inheritance : create class that implements the interface
Similar Threads
-
What about variables? implements Interface > extends
By Bigfatcat in forum New To JavaReplies: 8Last Post: 01-08-2012, 09:57 AM -
Extends a class that implements an interface
By monocole in forum New To JavaReplies: 2Last Post: 12-27-2011, 04:55 AM -
Create a Class that instantiates the GUI interface question
By Roastbeef in forum New To JavaReplies: 0Last Post: 10-31-2011, 12:55 PM -
Interface and implements
By Bored2 in forum New To JavaReplies: 27Last Post: 11-10-2010, 02:08 PM -
Interface Inheritance
By McChill in forum New To JavaReplies: 2Last Post: 03-04-2009, 03:53 AM
Bookmarks