• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A few questions ...

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Just took the IBM Mock Exam. I have a few questions...
1. What is a TOP LEVEL Class?
2. What is a Nested TOP LEVEL class?
3. What is a LOCAL class?
4. Can the JVM terminate a program that is runing a USER thread?
5. Can the JVM terminate a program that is runing a DEAMON thread?
Please Help...

[This message has been edited by monty6 (edited June 19, 2000).]
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Top level class is the one at the top.
Nested Top level class is the inner class declared with static
keyword.
public class test {
static class inner {}
}
}
Local class is the class declared within the scope of a method.
public class test {
public void method() {
class inner {}
}
}
JVM will not exit when there are any user threads running.
JVM can exit when there are only daemon threads running.
Hope this helps.
Ram
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Not sure if some of these are standard terms present in JLS.. but I guess this is what they are supposed to mean.
1. What is a TOP LEVEL Class?
class TopLevelClass
{
class InnerClass
{
class InnerMostClass{}
}
}
2. What is a Nested TOP LEVEL class?
??
A nested class is defined inside another class ( the other class is the top level class, so I'm very confused if there can be a class which is nested as well as top level)
3. What is a LOCAL class?
one defined inside a method
4. Can the JVM terminate a program that is runing a USER thread?
No, ( it exits when a user thread calls exit(), and is no longer running )
5. Can the JVM terminate a program that is runing a DEAMON thread?
Yes. JVM terminates and exits when only daemon threads remain.
cheers,
vivek
[This message has been edited by vivek rai (edited June 19, 2000).]
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
u will find the differences of local classes here
regds
Rahul.
[This message has been edited by rahul_mkar (edited June 19, 2000).]
 
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is daemon thread, can someone explain it?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank-you... an old post i have forgot about
monty
reply
    Bookmark Topic Watch Topic
  • New Topic