A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Arduino in Action
this week in the
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
Java in General
initilisation of classes vs interfaces
Joined: Aug 01, 2006
Dec 12, 2006 07:28:00
May I know if there is any difference between classes and interfaces initilisation?
Joined: Aug 05, 2005
Dec 13, 2006 03:16:00
Interfaces cannot be initialized except when implemented by a class. If you have an interface MyIntf, you cannot write 'MyIntf a = new MyIntf()', but if you have a class 'MyClass implements MyIntf' you can write 'MyIntf b = new MyClass()'.
This is rather basic to Java, so I recommend
Entia non sunt multiplicanda praeter necessitatem
I agree. Here's the link:
subject: initilisation of classes vs interfaces
Will every class inherit the object class?
interface extends interface ?
true or false
"Top Ten Topics that Everyone Thinks are on the SCJP Exam, but Aren't "- Bert Bates
Doubt in Interface
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013