bante

Greenhorn
+ Follow
since Jun 19, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by bante

I try your codes but it works fine on my machine. If I set the frame visiable before I set the size, I can see the frame (very small) and then it expands to the specified size immediately.
Here is how I fix your code. You have to understand how try/catch works.
public boolean check(String x)
{
try{
System.out.println(x+"-one");
}catch(Exception e)
{
System.out.println("in catch");
return false;
}
System.out.println("here0");
return true;

}
}
There are two compile errors:
1. Error in line 3, because the top class can not access the
fields in the member class.
2. Error in line 14.
k.arrayC[i].c + " " + k.arrayC.mult);
Notice that mult is not a field of arrayC. arrayC is an
array only. If you change it to k.arrayC[i].mult you will
still have compile error, because mult is a member of
the class K, not class K.C
I believe Savithri is right.
In float f = 1/3; The right hand side is first caculated.
The result integer 0 is thenprompted as 0f and assigned
to the left hand side.
I don't understand why i=i++ then i is equal to 0 either. Try
the following code:
public class Inc{
public static void main(String argv[]) {
Inc inc = new Inc();
int i = 0;
int j=0;
i = j ++;
//i=i++;
System.out.println("i ="+i+" j="+j);
}
}
The result is i=0, j=1.
This means the value of j is passed to i
and then j++; If this is true, in the case of i=i++, the value of i is first passed to i. Then i++; So finally, i is eaqual to
1.
[This message has been edited by bante (edited July 05, 2000).]
it is 3. In the JDK1.2 API, the container
class is declared as:
public class Container extends Component
[This message has been edited by bante (edited July 04, 2000).]
How about this:
The base class has the static method
public static void main(String [] args).
and the child class has the same method:
public static void main(String [] args)
How do you explain?
I don't see any problem. in your hello directory you compile your file xyz.java. Then you go up one level of the directory
(cd ..) and run your program by "java hello.xyz"
cheers
in Java, a flot point number must be suffix a "F" otherwise java will think it is a double. For example, 1.0 is a double,
and 1.0F is a float.
If you have this sentence:
float a = 1.0F/3.0F * 3.0;
java compiler will complain there is no explicit cast, because the result of 1.0F/3.0F has been promoted to be a double
I tried my code on my Linuxppc (iMac) JDK1.2, it is normal. I also tried on an Enterprise SUN OS 5 (JDK1.2) and I don't see any problem. 20 is a much larger number compared to 0. If there is a problem, I think SUN deliberately makes trouble for Microsoft.