nan s

Greenhorn
+ Follow
since Dec 28, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by nan s

Sorry rajani and all,
I have a typing error about this "a) void zzz{}", i checked again, IT IS "void zzz(){}", and their explanation of why a is incorrect as: "A final method may not be overridden, thus A is illegal."
Consider the following class definition:
public class Parent{
final void zzz(){}
}
Which of the following methods may appear in a subclass of Parent,
when the subclass is in a different package from Parent?
a) void zzz(){}
b) void zzz(int j){}
c) final void zzz(float f){}
d) public final void zzz(double d){}
they have Answer is b,c,d
i am sorry for error.
nan
23 years ago
Sorry rajani and all,
I have a typing error about this bloody "a) void zzz{}", i checked again, IT IS "void zzz(){}", and their explanation of why "a" is incorrect as: "A final method may not be overridden, thus A is illegal."
Consider the following class definition:
public class Parent{
final void zzz(){}
}
Which of the following methods may appear in a subclass of Parent,
when the subclass is in a different package from Parent?
a) void zzz(){}
b) void zzz(int j){}
c) final void zzz(float f){}
d) public final void zzz(double d){}
they have Answer is b,c,d
i am sorry for error.
nan
23 years ago
Question:
Consider the following class definition:
public class Parent{
final void zzz(){}
}
Which of the following methods may appear in a subclass of Parent,
when the subclass is in a different package from Parent?
a) void zzz{}
b) void zzz(int j){}
c) final void zzz(float f){}
d) public final void zzz(double d){}
they have Answer is b,c,d
But I wonder subclass is in different package with Parent,
so subclass can not see final void zzz() in Parent,
because zzz() is "default", so i think there is no overridding here.
where i am wrong?
23 years ago
Hi!
I try to compile the following code, and get a compile error
said:
Test.java:4: operator & cannot be applied to int,boolean
if ( i&j == 4 )
^
1 error

public class Test {
public static void main(String[] args){
int i = 4, j = 7;
if ( i&j == 4 )
System.out.println(" equal ");
else System.out.println(" not equal");
}
}
what is the compiler talking about?
newly version of R&H book does cover CardLayout
assume we have
class B{}
for relation "class A is a class B",
u can write your code as:
class A extends B{
//
//
}
if relation is "class A has a class B"
you can code as,
class A{
B b;
//
}
Hi Ajith,
could you please give me information(web site) about;
I/O and inner class
please thanks
item 12.
i think it is GridBagLayout, set weighty some vaule, that let Horizon resize and vertical no change.
last item
if one thread call notify(), u don't know who is on the first of waiting queue, after the first waiting queue thread enter ready queue , the highest priority(or first of same highest priority) thread will run.
am i right?
in situation of non-static,if i am in inside of an instance of inner class, how can get "this" of outer class?
class OuterOne{
int i2 = 0;
class InnerOne{
int i = 0;
void amethod(){
System.out.print("i of InnerOne = "+i);
System.out.print("i2 of OuterOne = "+this.i2);//is this correct? i
}//end of amethod
}//end of inner
public static void main(String[]a){
OuterOne.InnerOne j = new OUterOne().new InnerONe();
j.amethod();
}//end of main
}//end of outer
where can i get reference variable of OutOne object?
Hi Sean,
Thanks Sean, it helps, thank you!
nan
The very important thing is that you have to understand the difference between "==" and object1.equal(object2),in u case object is the String class.
"==" compares two reference variables and string1.equal(string2) compares content of two string objects
I got a compile error said loss of precision, what is wrong?
public class Test3{
public static void main(String [] arg){
byte a = 1;
byte b = 2;
byte c = a + b;
System.out.println("c= "+c);
}
}
"Complete Java 2 Certification Study Guide" Second Edition
by Simon Roberts
Philip Heller
Michael Ernest
nan
That's right,
i mean:
first; program set arr[0] = 0
then; program set a[j] = 10
then set a[j] =9
then set a[j] =8
....
at last set a[j] = 0
that's why print all '0'