• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

8 questions I dont understand while studying for SCJP

Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I want to give my SCJP exam sometime this month. I was reading A Concise and Comprehensive Study Guide for SCJP by Dr. Paul S Sanghera. I would like to ask the learned members of this forum you a few queries that I have. I shall be grateful if you would kindly find time to reply me with your valuable suggestions

1. I know that: If a class is declared final, it means the class cannot be extended, and a final method cannot be overridden. If the element declared final is a variable, that means the value of the variable is constant, and cannot be changed.

My question is: If a final variable is inherited in another class, can it be accessed? And can its value be changed?

2. My question is: Could you please give an example of method call conversion of object reference types?

3. My question: Is it possible to inherit the main() method?

4. My question is: What are anonymous inner classes? Where are they used practically? How are they defined? What is their scope? Can they access variables of the outer class? If so how?

5. Can inner classes be defined inside a method? What is their scope? Can they access the variables within the method? Can they access the variables of the outer class?

6. Are all methods defined in java.lang.Math static?

7. What are factory methods?

8. My question: Can interfaces have classes?

Thanks for your help!
waiting for your quick reply!
Posts: 69896
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Shankas Sanyal.

We don't simply answer that sort of question, but expect people to provide what they think the answers are.

What do you mean by "method call conversion?" Not a phrase I am familiar with.

As for anonymous inner classes, inheriting static members, final members, you will find lots of useful hints for those using the search mechanism above. Hint: for inner classes, try searching the Swing/AWT forum as well as beginners.
As for methods of java.lang.Math, have you looked in the API documentation?

Please tell us how you get on.
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most of these questions can be answered by writing simple test code, which is a great way to learn.

(JLS 5.3 - Method Invocation Conversion.)
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic