aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Confusing exam questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Confusing exam questions" Watch "Confusing exam questions" New topic
Author

Confusing exam questions

Arun Paliwal
Greenhorn

Joined: Jul 18, 2013
Posts: 10
I was attempting a question, which 'seemed' to be testing me on inheritance. To my surprise, it turned out on assigning numeric values to a variable. Is it normal in the real exam also?

Question reference: http://cafe4java.com/mockexams/oca803/mock1/q4.php

Question:


Thanks,
Arun
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

Arun Paliwal wrote:I was attempting a question, which 'seemed' to be testing me on inheritance. To my surprise, it turned out on assigning numeric values to a variable. Is it normal in the real exam also?

Question reference: http://cafe4java.com/mockexams/oca803/mock1/q4.php

Question:


Thanks,
Arun


What's abnormal in it ? don't expect "hello world" programme in exam.


My one regret in life is that I am not someone else.
- Woody Allen
Roshi Kumar
Greenhorn

Joined: May 13, 2013
Posts: 21

you will be tested on multiple topic in a same question ! Be Prepared for that.


SCJP/OCPJP 6 85%
Arun Paliwal
Greenhorn

Joined: Jul 18, 2013
Posts: 10
@Roshi,

Thanks for replying. Its helpful. I was kind of.. lost when I attempted this question. Thanks, buddy! :-)

@Meeta,

I believe your reply was quite rude. This was my first post at JavaRanch and I don't think that my question was baseless. I believe a lot of persons, who haven't written this exam might have similar questions.

Moreover, you were never 'invited' to answer this question. So I would advice that instead of answering a question the way you did, please don't answer questions here. I looked at some of your other replies and noticed that you have been answering in a similar (rude) manner.

Did you read the terms and conditions when you joined JavaRanch? There was only one - 'Be nice'. I hope you follow it the next time you hit the 'post' button.

Jack McLaren
Greenhorn

Joined: Jun 17, 2013
Posts: 13

You have to learn how to answer a question in exam. Before concluding that what this program does, watch out for small errors.It will save your time.


I AM THE LAW.
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

Jack McLaren wrote:You have to learn how to answer a question in exam. Before concluding that what this program does, watch out for small errors.It will save your time.


Well said Jack

@Arun Please don't take me wrong, i just want to say that they are not gonna ask you straightforward questions in EXAM.Please try to solve K&B book mock questions it will give you basic idea that what type of questions come in exam.Thanks, anyways no regrets
Comal Rajagopalaratnam Muthukumar
Ranch Hand

Joined: Mar 18, 2012
Posts: 90
Arun Paliwal wrote:I was attempting a question, which 'seemed' to be testing me on inheritance. To my surprise, it turned out on assigning numeric values to a variable. Is it normal in the real exam also?

Question reference: http://cafe4java.com/mockexams/oca803/mock1/q4.php

Question:


Thanks,
Arun


Hi

A sampler jar file for you to try
use

java -jar Chapter01.jar

The jar file sent vide attachment
Pl reply

CRMK


Rahul Parakkat
Greenhorn

Joined: Feb 13, 2012
Posts: 8

As it is given in your question, it may not even compile

reason : The double variable declaration cannot be 107_f ( the f token has to be without any space from the float/double literal )

If the Question was like this :

package mnp;

class Boo {
double foo = 107f; // Note the double declaration
}
class Derived extends Boo {
double foo = 145f;
}
class Inherit {
public static void main(String args[]) {
Boo base = new Derived();
System.out.println(base.foo);
}
}


The code would compile & run successfully , producing output

107.0

Reason is : Even though class Derived extends Boo, as part of inheritance only methods are inherited and not the instance variables
So the Boo reference variable is still referring to its own instance variable

Note : Please go through Inheritance , Overloading & Overriding for better understanding

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Confusing exam questions