Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

interface problem

 
deepesh mathur
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i am writing this post to ask that:
1.is 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???


2.is 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
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried this?

Compilation is one thing. Instantiation is another.
 
deepesh mathur
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry but actually i can't get you really ...
 
Henry Wong
author
Sheriff
Posts: 22607
111
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Henry
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!