Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dear all, i created a set of mock exam, please try it.

 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please try it and give me some feedback, hope it helps.
The URL is:
<code> http://www.geocities.com/sun_guoqiao/
</code>

------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
 
ashok khetan
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey! u are doing a fabulous job!it's pretty good.
keep going on man!!!

ashok.
 
leena rane
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guoqiao,
Thanx a lot for the efforts,
Your efforts will be appreciated by all aspirants SCJPs like me.
thanx again
 
Gagan Indus
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gr888888 work Guoqiao !!!
liked ur presentation style , n specially those handy explanations with answers
it 'll indeed turn out to be very helpful for us SCJP-aspirants
i 'll surely give u feedback to make it better , if i find any sort of error etc
Once again 'll like to thank u for ur effort put into making this .. have dis cool drink wid me !
Keep up da good work ma'n , u doin gr8 job , waiting for more
------------------
Gagan (/^_^\)
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good job Guoqiao Sun!!
Thank you!!
 
Vanitha Sugumaran
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great site Guoqiao! The way you have explained the answers are very helpful.
Thanks,
Vanitha.
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all for your reply and encourgement, I 'd like to know the difficulty level of this mock exam as compared to other mock exam. If it is too difficult, i will make it easier in my later mock exam.
I have no means to know it myself since when i created it, i use compiler all the times in order to get the right answer and show it to you.

------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have reviewed once again of the mock exam 1 and removed several wording errors there. Please tell me if you find any errors! Thank you!
------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
 
Usha Damarla
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<PRE>
Hi Guoqiao Sun
Your idea is excellent.
Question number 17 was quite interesting to me.

public class Test017
{
public static void main(String args[])
{
System.out.println(Math.abs(Byte.MIN_VALUE) > 0);
System.out.println(Math.abs(Long.MIN_VALUE) > 0);
System.out.println(Math.abs(Short.MIN_VALUE) > 0);
System.out.println(Math.abs(Float.MIN_VALUE) > 0);
}
}

I was expecting "true, true, true, true"
Refered Sun's web site for abs() method. http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Math.html#abs(long)
What I understood is,
When argument to abs() is either Integer.MIN_VALUE or Long.MIN_VALUE, the result remains same, ie.,
negative
Integer.MIN_VALUE = -2147483648 if we negate this value, which is 2147483648 and
it CANNOT be represented in int type.
The max value that can go into int data type is 2147483647
Same theory applies to abs(Long.MIN_VALUE)

Cheers
Usha
</PRE>
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Usha, I will put your words into the explanation of the questions 17.

------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
 
Usha Damarla
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<PRE>
Hi Guoqiao,

I think the answer for question 42 is D. I got the output "0"
Here is the question. Please correct me if I am wrong.
public class Test042 extends Super
{
private int i = 1; //1

public static void main(String args[])
{
Super s = new Test042(); //2
System.out.println(s.i); //3
}
}
class Super {
protected int i = 0;
}

</PRE>
 
Usha Damarla
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<PRE>
Small typo error in question # 31.
You got two choices with the same name.
D: The code does not compile because of line //1
D: The code does not compile because of line //2
The last choice should be "E". And the answer for this question
is "The code does not compile because of line //2 "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
What is the output of trying to compile and run the following code?
(Select one correct answer)
-----------------------------------------------------------------------
public class Test031
{
public static void main(String args[])
{
StringBuffer sb = new StringBuffer("Hello");;
String st = new String("World");

System.out.println(sb.append(st)); //1
System.out.println(st.concat(sb)); //2
}
}
-----------------------------------------------------------------------
A: The code compiles and runs with output:
HelloWorld
WorldHello
B: The code compiles and runs with output:
WorldHello
HelloWorld
C: The code compiles and runs with output:
Hello
World
D: The code does not compile because of line //1
D: The code does not compile because of line //2
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Usha, I will check it out and soon correct it.
Hi, Usha, as to question 42, you are right, I have correct it and if you like, go to have a check!
------------------
Guoqiao Sun
Sun Certified Programmer for Java� 2 Platform
[This message has been edited by Guoqiao Sun (edited September 03, 2001).]
 
Usha Damarla
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi Guoqiao,
I am back again working on your mock exam. I like the way you presented the answers, placing them next to questions, reduces lot of overhead, looking back and forth etc.
One suggestion regarding Q22.
I don't think you need
"What is the output of trying to compile and run the following code? " at the beginning of question number 22.
Becz there is no code in the question.
I think you copied the tags from the previous questions and made corections to it.

usha

[This message has been edited by Thomas Paul (edited September 04, 2001).]
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Usha, I will correct the error as you mentioned in question 22.
You are right, I created this mock exam with the intention of easy using. Since when I prepared for the exam and did the mock exam, I found it very tedious to scroll up and down to check the answer.
Good luck!

------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
 
Usha Damarla
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Typo error in Q#7 just like question 31.

D: The code does not compiles.
D: The code compiles but cannot run.
Okay, its time to go for lunch, good work Guoqiao.
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again, Usha, error has been cleared as to Q#7.

------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
 
Rashmi Trivedi
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Guoqiao
You are a good man. I am sure every body in this forum will appreicate your effort. I wish i could do the same thing once i get my scjp.
Good luck mate and keep it up.
Rashmi
Originally posted by Guoqiao Sun:
Please try it and give me some feedback, hope it helps.
The URL is:
<code> http://www.geocities.com/sun_guoqiao/
</code>


 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Rashmi. You can consider to collect valuable material and resource during the time of your preparation if you want to share your something about SCJP with others later time.
Good luck to your SCJP tour!
------------------
Guoqiao Sun
Sun Certified Programmer for Java2 Platform
Visit http://www.geocities.com/sun_guoqiao/ for mock exam from me
[This message has been edited by Guoqiao Sun (edited September 03, 2001).]
 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guoqiao,
Really excellent job done, my ddear friend! Have a can of beer with me....

------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer For Java 2 Platform
--When you learn something, learn it by heart!
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Ashik, thanks for the compliment. Very glad to have a can of beer with you...

Best luck!

------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
Try my mock exam¹ at my homepage.
[This message has been edited by Guoqiao Sun (edited September 04, 2001).]
 
Adam S-R
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guoqiao
Great site - I like your explanations to the questions. The only thing I would say is would you consider making the text a bit bigger? I can't read it comfortably on my 15" monitor without straining my eyes. Perhaps you might consider using a serif font such as arial or verdana, or making the text bigger?
Adam
 
Niu Xiuyuan
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why i can' open the url?
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Adam, I will make the text bigger soon. Thanks for the feedback. Good luck!
Originally posted by Adam S-R:
Guoqiao
such as arial or verdana, or making the text bigger?
Adam


------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
Try my mock exam¹ at my homepage.
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Xiuyuan, i don't know the reason, it should work with the URL. Please try again!
Good luck!
Originally posted by Niu Xiuyuan:
why i can' open the url?


------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
Try my mock exam¹ at my homepage.
 
swati bannore
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanx Sun....very good questions..I enjoyed it!
There is one small mis-woring error in q45


What is the output of trying to compile and run the following code? (Select one correct answer)
-----------------------------------------------------------------
public class Test045 extends Super { }
class Super
{
public static void main(String args[])
{
System.out.println("super main!");
}
}
-----------------------------------------------------------------
A: The code compiles but throws NoSuchMethodError
at runtime.
B: The code does not compile.
C: The code compiles and runs without any output.
D: The code compiles and runs without output:
super main!

Of, crse, option is D...but it shd read," The code complies and runs with Output:super main!
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, swati, the error has been cleared as you instructed.
Good luck!
Originally posted by swati bannore:
Hi,


[This message has been edited by Guoqiao Sun (edited September 04, 2001).]
 
Adrian Uribe
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question 1 on this mock exam seems to address a bug in the jdk. The explanation shows what is output from running the code but it does not seem logical that this is what should happen. Comments?
Good job on the rest.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm really impressed Guoqiao. Great job. I have just gone over it briefly but I know that these mocks will help me on my way to SCJP, which is by the waay 28 sep.
Thanks again. I will spread your link to my friends at work.
// Mathias
 
Dallas Hockley
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree that that seems to be an inconsistency or a bug on the JDK. System.out.println(t1.toString()) should be the same as System.out.println(t1) as I understand the automatic typecast/method call in that situation. I've verified it on 1.3.1 on Windows, and on 1.4 Beta 2 on Windows. Very odd.
Update: And on 1.3.0_02 on Linux. and kaffe 1.0.6 (Java 1.1) on Linux. So it's consistent and/or historic whatever the case.
Dallas

[This message has been edited by Dallas Hockley (edited September 05, 2001).]
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to Adrian, Mathias and Dallas for your feedback.
So do you think it is proper to include the question in the mock exam? Or should I remove it?
Best regards,
I am busy with creating my mock exam 2.

------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
Try my mock exam¹ at my homepage.
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Adrian and Dallas, i have put your words about question 1 on my mock exam answer. Thank you!

------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
Try my mock exam¹ at my homepage.
 
Vanitha Sugumaran
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guoqiao,
Your mock exam helps a lot.
I think there is an error in this question,

But I think this code will give compiler error, since line 1
is not using outer class instance to refer the inner class. You can change the answer choice, or you can change the make it as a
static inner class.
Thanks for your wonderful job,
Vanitha.
 
Vanitha Sugumaran
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also one more thing, for the question 01-15,
At present the explanation is "Please see the JLS for reference"
Since the question is about the constructors of the class FileOutputStream you can say it as Please refer Java API.
Just a little suggestion,
Vanitha.
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Vanitha, I will change the words there.
To be honest, i am not quite clear what is the difference between JLS and Java API. Please tell if you know.
As to question 01-14, since the outer class just access the static variable in the inner class, thus no instance of outer class is needed. You can use Java compiler to confirm it.
Regards,

------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
Try my mock exam¹ at my homepage.
 
Vanitha Sugumaran
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is what I got when I compiled the question 14.

Test014.java:12: Can't make a static reference to inner class Test014. Inner.
System.out.println(Test014.Inner.j); //1
1 error

JLS is Java Language Specification.
API is Application Programmer Interface
Thanks,
Vanitha.
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Vanitha, thanks for telling JLS and API.
As to question 14, i can confirm with you that it compiles and runs with the output i mentioned in the question in my machine. I don't know why you got error. What version of JDK you are using? I am using 1.3.0
Regards,
------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
try my mock exam¹² at my homepage.
 
Vanitha Sugumaran
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am using JDK 1.2
Vanitha.
 
Jon Ellison
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guogiao,
I got the same error that Vanitha recieved... I am using JDK 1.3
It didn't compile and run until I made the inner class static.
So I guess that "A" may be the correct answer here?
Regards,
Jon Ellison
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Jon and Vanitha. Now I finally found the error in my question. The reason is that I use Forte 2.0 for my compiling and testing of the programme. Just now I tested it just using JDK and found the error.
Sorry for the confusion caused. I will correct the error soon in my question.
Thanks and best wishes,

------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
try my mock exam¹² at my homepage.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic