• 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:

JSecure mock exam doubts

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,
I came across following questions in JSecure mock exam which I had doubts about. Thanks in advance for your time.
____________________________________________
Top level class can be
1.publc
2.friendly
3.protected
4.private
5.abstract
Answers given were 1,5. I am not sure about Abstract answer?
Can somebody explain this.
____________________________________________________________
What is access modifier for no-arg constructor?
Answer given is coderanch, I thought it would be default access which is package? Any thoughts?
_____________________________________________________________
Non-static inner class access private instance variables in
enclosing class. True/False.
Ans given is false, my answer was true.
I have coded this and private instance variables can be accessed by non-static inner class, any thoughts?
______________________________________________________________
Java doesn't care about order of appearence of modifiers. T/F
My answer False based on my understanding that certain modifiers
like abstract has to be first modifier for class definition.
Can someone explain this?
Their answer was true.
_______________________________________________________________
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sarang,
All the answers provided by Jsecure to the questions you have mentioned are right except the question about non-static inner classes. But when I looked at my copy of JSecure the answer they have given is right. This is how is goes,
which statement is true about a non-static inner class?
1. It must implement an interface
2. It is accessible from any other class
3. It can only be instantiated in the enclosing class
4. It must be final if it is declared in a method scope
5. It can access private instance variables in the enclosing object
And the answer given is 5. So they are right!
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by milton:
Sarang,
All the answers provided by Jsecure to the questions you have mentioned are right except the question about non-static inner classes. But when I looked at my copy of JSecure the answer they have given is right. This is how is goes,
which statement is true about a non-static inner class?
1. It must implement an interface
2. It is accessible from any other class
3. It can only be instantiated in the enclosing class
4. It must be final if it is declared in a method scope
5. It can access private instance variables in the enclosing object
And the answer given is 5. So they are right!


Could you tell me where the JSecure mock exam is online??
Thanks,
Savithri
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Savithri,
JSecure is not free . You will find it in Paul's mock exam list or go directly to netcraftonline.com
 
Sandra Marti
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oops! forgot to mention that option 2 in the example given by Milton is true too, 'inner classes can be accessed from any other class depending on their access modifier'. But I guess Milton did not mention that point because he was trying to answer sarang's question.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic