It's not a secret anymore!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes A mock question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "A mock question" Watch "A mock question" New topic

A mock question

Yi Dong

Joined: May 19, 2003
Posts: 22
Question 28.
public class ADirtyOne
//char a = '\u000A';
An attempt to compile the above class
1. will complete successfully.
2. will compile sucessfully but with a warning message.
3. will not compile - complains on an invalid expression.
why the code can not be comnpiled, I thought // is commenting out that line of code, but when I try to compiled it, the compiler gave me an error.
Thanks in advance !
Anish Doshi

Joined: Jun 13, 2003
Posts: 23
Can you plz type d error for us so that we can know what it actually is.

Sun Certified Programmer for Java platform 1.4
Anish Shar

Joined: Nov 10, 2003
Posts: 4
if there is no body should it not be an abstract method in a abstract class

-<br />everybody makes a mistake, some just dont ever learn!!
Yi Dong

Joined: May 19, 2003
Posts: 22
Hi Anish:
The error is: unclosed character literal
Yi Dong
Tom Wolve
Ranch Hand

Joined: Sep 22, 2003
Posts: 32
maybe it helps to know that unicodes like '\u000A' are replaced once before compiling.

will be

which will cause a compile error.
Cathy Song
Ranch Hand

Joined: Aug 24, 2003
Posts: 270
This link might be useful..
I agree. Here's the link:
subject: A mock question
It's not a secret anymore!