• 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
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

java.awt.Container

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I came across a question in the JavaExams mock test:
Q)
Which category does java.awt.Container belong in?(choose one)
a: interface
b: abstract class
c: normal class
d: none of the above
The correct answer was given as c: normal class
But the Container class is an abstract class so the right answer should be b:.
or am I missing something.
Please help.
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm pretty sure that as of Java 2, Container is no longer abstract.
 
Ajit Deshpande
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 9 of the RHE book under the section 'Containers and Components' says "The container class is abstract: its most commonly used concrete subclasses are Applet, Frame and Panel." Patrick Naughtons book on Java2 does'nt say anything about the class being abstract.
Confused?
Can anybody help please?
 
Rancher
Posts: 241
Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Container was abstract in 1.1 but is not abstract in 2. What you would do with one is another matter. I've never actually seen it used.
Always check the RHE with the Errata at their site. The earlier versions have a lot of errors. Perhaps someone can provide the link.
Eric
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajith,
I think you have the older version as the latest version which I have clearly says that Container class was abstract, but now it is'nt. As Eric says, please always check the errata. The link is here.
Suma
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Contianer class is not abstract, however Component is ..I think you are confusing both of them ..Container implements the methods of Component
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Container class is a normal class in Java 2.0. It was an abstract in 1.1.
Ram
 
reply
    Bookmark Topic Watch Topic
  • New Topic