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
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
Ron McLeod
Paul Clapham
Tim Cooke
Devaka Cooray
Sheriffs:
Liutauras Vilda
paul wheaton
Rob Spoor
Saloon Keepers:
Tim Moores
Stephan van Hulst
Tim Holloway
Piet Souris
Mikalai Zaikin
Bartenders:
Carey Brown
Roland Mueller
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
Thank you my well lotioned goddess! Here, have my favorite tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
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...