• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

interface within a class

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I havent seen any explanation on Interfaces with classes in K&B and there are
quite a few quesions in the mock exams on this issue. I just wanted all of u to look in to this topic.
--Sricharan
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many of the topics I've seen on interfaces are based on casting and converting objects (implements vs. extends in a casting situation).
Is this the direction you would like to explore?
I'd like to futher my knowledge in the rules for casting objects as well as runtime converting objects too.
 
Sricharan Modali
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
What i meant was questions like these
Which of the following statements is not true?
a. An interface that is declared within the body of a class or interface
is known as a nested interface.
b. A constant can be a member of an interface.
c. A class declaration can be a member of an interface.
d. A class that implements an interface must implement all of the methods
declared within the interface.
e. None of the above.
The answer is d
For this kind of a question we need to be aware that this is possible..
interface I
{
public class Inner
{

}
interface InnerInterface
{

public void hi();
}
}
and even this ....
public class ClassName
{
public static void main(String[] args)
{
ClassName cn = new ClassName

}
interface Inclass
{

}

}
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic