aspose file tools*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "A mock question" Watch "A mock question" New topic
Author

A mock question

Yi Dong
Greenhorn

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
Greenhorn

Joined: Jun 13, 2003
Posts: 23
Hey,
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
Greenhorn

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
Greenhorn

Joined: May 19, 2003
Posts: 22
Hi Anish:
The error is:
ADirtyOne.java:4: unclosed character literal
}
ADirtyOne.java:4:<identifier>expected
}
Yi Dong
Tom Wolve
Ranch Hand

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

will be

which will cause a compile error.
Greetings
Tom
Cathy Song
Ranch Hand

Joined: Aug 24, 2003
Posts: 270
This link might be useful..
http://www.javaranch.com/certfaq.jsp#q14
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A mock question
 
Similar Threads
Question from K&B mock test | Anonymous inner classes
Head First Book Questions
Do I need to install Java EE ?
char assignment
Circular dependency between parent class and child class