• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

please clear my doubts

 
suni aloor
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do have SCJP exam on next week.
Now iam really getting confused with inner classes.Just clear my dounts like yes or no.
1.Is top level nested class /interface must be static.It can contain both static and non static member variables, But it access only static members of the enclosing class.
we can use any accessmodifiers fo them.
2.Local class(either static or nonstatic) cannot contain any access modifiers.
3.we cannot define any static members in Local class,Non static inner class, anonymous class.
4.Question on Unicode
a=\u0061
can i use quotes like ('\u0061') .
I know i should not use but i want to clear my doubt.
5. Treemap and Treeset are only have comparator method.
am i correct.
I want some good explanation on inner classes.
please clear my doubts.
thanks
Suni

 
Ashish Chande
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
1. True
2. True. Local class are declared in a method and hence no access modifier.
3.True, Non-static inner class cannot have static members.But they can have final static members.
4. All elements(Keys) inserted into an sorted set(Sortedmap) must implement the Comparable interface.
All The Best
Ashish
 
Sameer V
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suni:
Take a look at Khalid and Rasmussen's book for inner classes (or just about anything else), it's damn good.
I just passed the exam this morning....play with a lot of mocks and use each mock as a learning experience....document what areas you lost most points on on the mocks and read up on that. I know I'm not tell you something you don't already know...but still....sometimes it helps to hear it from somebody else I think!
Focus on threads....there'll probably be quite a few questions on threads. Also, focus on the basics....tons of questions on fundamental stuff.
Good luck.
Sameer
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic