View Single Post
  #2 (permalink)  
Old May 27th, 2004, 03:03 AM
freezotic freezotic is offline
Authorized User
Join Date: Sep 2003
Location: den Haag, , Netherlands.
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts

quote:Originally posted by DRAYKKO

1. On page 123 the Unicode character \U03C0 doesn't generate Pi as the book says, but rather the character "?".
1. The ? means your system does not recognize the unicode character.
The display of unicode depends on the local machine implementation.
You can make a test loop to see what can be displayed and what characters are out of reach for your system. E.g.

for(int i = 0; i < 256; i++)
    System.out.println(i + " " + (char)i);

2. On page 125 the following code generates an error when I use the NetBeans editor:

if(anyString == null)

The error is: non-static variable anyString cannot be referenced from a static context
        if(anyString == null)
2. This happens quite often, and is not hard to fix. The problem is that you are calling an instance variable from a static context, e.g. the static method main().
Here you can either take care that:
- anyString is static
- the method that calls anyString is an instance method

This will improve your programming structure.