• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error again ( 2nd time, same site ). Mr Hareet! Where are you?

 
Arijit Daripa
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mr. Hareet!
One of the questions in
http://www.irixtech.com/java/scjp/mock-exam/practice-test-2 is



Your answer is (a) and (c).
But darling! I will go for (a) and (b).
 
Ashish Hareet
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed, thanks
 
vidhya suvarna
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a doubt here,
As interface methods are implicitly public & abstract, so it should not be any problem even if we declare them.
So option e can be right?

Correct me if i am wrong.
 
Ashish Hareet
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by vidhya suvarna:
As interface methods are implicitly public & abstract, so it should not be any problem even if we declare them.


You are correct here Vidhya, it is ok to declare methods in an interface as abstract.

Originally posted by vidhya suvarna:

So option e can be right?

No, option e cannot be correct cause it puts the curly braces at the end of the method declaration. Abstract methods cannot provide an implementation & even by putting empty curly braces we're signaling the method implementation.

Had option e been "public abstract void hasFeed( ) ;", then option e would've been correct.

HTH
Ashish Hareet
 
vidhya suvarna
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ashish.

One more query,
I tried both the pratice exams on that site and couldnt get more than 70%. Does that mean i am'nt prepared well. Please can you provide with with more mock test links.

Thanks,
Vidhya
 
Ashish Hareet
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by vidhya suvarna:

I tried both the pratice exams on that site and couldnt get more than 70%. Does that mean i am'nt prepared well.

I wish I could tell end users that getting X% in mock exams means you're ready for the real thing, but I can't. Being prepared is a personal thing. Mock exams can give you a feel for the real thing & help you explore areas that you might've otherwise just glanced over. After giving mock exams don't get disappointed with your scores. Go back & analyze why you got it wrong. My website has this option if you're registered & most downloadble mock exams will review your answers. In the end, ask yourself if you are ready, cause only you'll know if you are ready or not.

Originally posted by vidhya suvarna:

Please can you provide with with more mock test links.
Vidhya

Check the first 2 links in my signature, you'll find about 10 mock exams in all. My website has about 140-150 questions at the moment.

You may also want to check other mock exams - http://faq.javaranch.com/java/ScjpMockTests

I'd like to add that you may want to get used to these 2 links
- http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html
- http://java.sun.com/j2se/1.5.0/docs/api/

Most cert prep books focus on the cert, but the 2 links above will always have answers to all your questions. The JLS may feel a little cryptic but it's the definitive book for Java.

HTH
Ashish Hareet
[ September 15, 2008: Message edited by: Ashish Hareet ]
 
Ashish Hareet
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ashish Hareet:
[QB]
Check the first 2 links in my signature, you'll find about 10 mock exams in all. My website has about 140-150 questions at the moment.

You may also want to check other mock exams - http://faq.javaranch.com/java/ScjpMockTests

I'd like to add that you may want to get used to these 2 links
- http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html
- http://java.sun.com/j2se/1.5.0/docs/api/

Most cert prep books focus on the cert, but the 2 links above will always have answers to all your questions. The JLS may feel a little cryptic but it's the definitive book for Java.

HTH
Ashish Hareet
 
vidhya suvarna
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks alot Ashish. I am working on the mock exams provided in your signature.

One query i came across while giving the mock:

Given the following overloaded method declarations

private static void objectCount(int i)
{
//version 1
}

private static void objectCount(Integer i)
{
//version 2
}

Which overloaded method gets called as a result of the following statement - "objectCount(new Byte((byte)10));" ?

The answer is supposed to be objectCount(int i) and i selected Compile-time error as new Byte((byte)10) is calling a Byte wrapper constructor.
So how can the answer be objectCount(int i)?

Kindly help!
 
Ashish Hareet
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vidhya,

Per JLS 15.12.2 - "A method is applicable if it is either applicable by subtyping (�15.12.2.2), applicable by method invocation conversion (�15.12.2.3), or it is an applicable variable arity method (�15.12.2.4)."

Take note of the method invocation conversion & refer to JLS 5.3 which allows for the following - "an unboxing conversion (�5.1.8) optionally followed by a widening primitive conversion. "

In the case of your question since there is no explicit overloaded version of objectCount which takes a Byte object, an unboxing conversion is applied to the Byte object followed by a widening which results in a method match with the overloaded method that accepts an int.

JLS 15.12.2 - http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#292575
JLS 5.3 - http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#12687

Did you try the code sample to verify if the answer was correct ? I got the impression you didn't. I try to provide questions with code so that end users can try out for themselves. The goal with my mock exams is to motivate end users to question the validity of any scenario which imho makes you well prepared for the real thing.

Anyways, I do apologize for the delayed response, if you'd like to get my attention you can leave a note in the iRix Forums for SCJP & better still create a new thread here on Javaranch, SCJP Forums to get more brains to help with your query.

HTH
Ashish Hareet
 
vidhya suvarna
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will surely to run and check the output myself before i query.
As i am preparing for 1.4 i wasnt aware of autoboxing concept.

Thanks for providing the details.
 
Ashish Hareet
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by vidhya suvarna:
I will surely to run and check the output myself before i query.
As i am preparing for 1.4 i wasnt aware of autoboxing concept.

Thanks for providing the details.


Vidhya,

You might wanna check this link for 1.4 specific exams on my site - http://www.irixtech.com/category/java/scjp-14
There are 3 tests for SCJP 1.4

Since you just mentioned that you selected the option, I made an assumption, apologize for that.

HTH
Ashish Hareet
 
vipin jain
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Ashish,

I am preparing for SCWCD5 is there any mock exam link available for same just like scjp5/6 ?
if yes please send me url.
 
Ashish Hareet
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vipin,

Unfortunately, I do not have any mock exam questions for SCWCD at this time. Let me check with a couple of folks I know, if they'd be willing to help set up mock exams for SCWCD. Will update this thread, if I manage to get some.

Thanks
Ashish Hareet
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic