Dear friends,

well my code is like the following in an JAppplet:

int j;
j = parseInt("123",2);
System.out.println(j);

I have import all things like:

import java.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import java.math.*;
import java.lang.Integer.*;
import java.lang.*;

but the compiler blames:

BinaryCalculator.java:253: cannot resolve symbol
symbol : method parseInt (java.lang.String,int)
location: class BinaryCalculator
j = parseInt("123",2);
^
1 error

unless I use the whole statement:

j = java.lang.Inetger.parseInt("123",2);


I have already import java.lang.Integer

why the compiler still can't recognize this? Can anyone explain this for me.

Also, if I just import java.*;

then is it all classes when they are needed will be included?

so why dun everyone just import the whole to prevent missing classes and compile error?