• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
  • Himai Minh
  • Carey Brown
  • salvin francis

inner class

Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • 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).]
Posts: 21
  • Mark post as helpful
  • send pies
  • 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.
Posts: 23247
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please see http://www.javaranch.com/ubb/Forum10/HTML/000180.html for details.
moose poop looks like football shaped elk poop. About the size of this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic