File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes interface problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "interface problem" Watch "interface problem" New topic

interface problem

deepesh mathur
Ranch Hand

Joined: Aug 13, 2007
Posts: 39
hi all,
i am writing this post to ask that: it necessary for an interface to have an concrete class(non abstract)implementation? what i mean to say is that can we have a source file compiled with only interfaces and it's implementing abstract classes without a non abstract class??? it the same case with a class extending an abstract class???
i.e. is it necessary to give an non abstract class extending an abstract class to compile code correctly???

i know i am a bit confused so kindly help...
marc weber

Joined: Aug 31, 2004
Posts: 11343

Have you tried this?

Compilation is one thing. Instantiation is another.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
deepesh mathur
Ranch Hand

Joined: Aug 13, 2007
Posts: 39
sorry but actually i can't get you really ...
Henry Wong

Joined: Sep 28, 2004
Posts: 20532

Originally posted by deepesh mathur:
sorry but actually i can't get you really ...

Basically, Marc is saying... Yes, it will compile. But what are you going to do with interfaces that don't have any implementations?


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
I agree. Here's the link:
subject: interface problem
It's not a secret anymore!