aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes please Help 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 "please Help" Watch "please Help" New topic
Author

please Help

Kapil Sakhuja
Ranch Hand

Joined: May 09, 2001
Posts: 34
PROBLEM 1
for(char c=0;c<1000;c++)
System.out.println(c);
GIVES CHARACTERS UPTIL C IS 128, AFTER THAT IT GIVES '?'
WHY ?
IF IT'S RELATED TO ENCODING SCHEME, KINDLY EXPLAIN ?
PROBLEM 2
System.err is an object of PrintStream
Also err is a static member of System Class
Please explain the above given lines.
PROBLEM 3
if i declare run() as synchronized method in a class implementing
Runnable, it is fine, it works in a synchronized manner.
But if declare run() as a synchronized method in a class
which extends Thread, it does not work in a synchronized
way. ?

Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Kapil,
I can help you with the first two questions.
1. It is related to the encoding scheme. You are probably using the 8859_1 encoding scheme in which only the first 128 characters are defined (ASCII characters). If you want a different encoding scheme you need to change your default.
2. The System class defines the following class variable:
public final static PrintStream err = null;
It is of type java.io.PrintStream. It is static so we can use it without creating an instance of System:
// Print error message
System.out.println( System.err );
Regards,
Manfred
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: please Help