• 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
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

inner class

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1.What might form part of correct inner class declaration and installation?

A. new simpleInterface(){} -true
B. new complexInterface(x) {} -true
C. private final abstract class c//abstract & final cannot be together.
D. MyClass extends OtherClass //false-body required
E. new MyClass() extends OtherClass{}//false-???

2.Why would a responsible Java programmer want to use a nested class?

a. To keep the code for a very specialized class in close association with the class it works with. -true
b. To support a new user interface that generates custom events. ???
2.What is the method used to schedule a thread for execution?
ans given is public void run()-but I feel it should be start()
[This message has been edited by hema janani (edited September 22, 2000).]
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1}--To answer the first question, I think the answer lies in the inner class declaration called Anonymous classes where u just declare a class inside a parameter declaration bracket of a method. The point here lies in just the declaration with the word "new" which implicitly recognises its duty to implement or to extend "without actually specifying it".
2) The first part of the nested class's importance can be very well understood by examining the eventlisteners, where they are used in plenty.
 
Trailboss
Posts: 24068
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
PROPER NAMES ARE NOW REQUIRED!
Please see http://www.javaranch.com/ubb/Forum10/HTML/000180.html for details.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic