Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Eclipse Collections Categorically: Level up your programming game
this week in the
Open Source Projects
forum!
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
Ron McLeod
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Programmer Certification (OCPJP)
Sample Question
ai dan
Greenhorn
Posts: 8
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I did the Oracle Sample exam and got the following question:
class Base { static int oak=99; } public class Doverdale extends Base { public static void main(String argv[]) { Doverdale d = new Doverdale(); d.amethod(); } public void amethod(){ //Here } }
The answers were:
Which of the following if placed after the comment //Here, will compile and modify the value of the variable oak? (Select two options)
super.oak=1;
oak=50.1;
Base.oak=22;
None of the above
The question says select two, but could the first three all work?
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
what happened when you try oak=50.1; ?
ai dan
Greenhorn
Posts: 8
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Seetharaman Venkatasamy wrote:
what happened when you try oak=50.1; ?
Oops, I see that now. I ran the code but didn't use the 50.1 value.
Thanks.
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
and Welcome to JavaRanch
Abhishek Khandelwalrawat
Greenhorn
Posts: 1
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The possible solution for using the static variable oak is :
super.oak=1;
oak=50;
Base.oak=22;
Doverdale.oak=22;
gaurav gupta sitm
Ranch Hand
Posts: 47
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
please give me link of Oracle Sample Exam Question Answer sheet
Stop it! You're embarassing me! And you are embarrassing this tiny ad!
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Marcus Green Exam#3 - question #40 and #54
Marcus's Exam Question
Inherited fields always follow the value of parent?
Marcus Green Exam #3, Question 40
Marcus Green Mock Exam#3 questions #40 & #54
More...