fan tung

Greenhorn
+ Follow
since Mar 22, 2003
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 fan tung

hi, siu,
i knew the 1st part but i don't understand is the second part. thank you walked me thru and it help me a lot.
thank you so much,
19 years ago
Hi,i had this beginner's constructor question (which constructor is executed first). this is my codes:
// create a super class
class A {
A() {
System.out.println ("Constructing A.");
}
}
// create a subclass by extending class A
class B extends A{
B() {
System.out.println ("Constructing B.");
}
}

// create a subclass by extending B
class C extends B {
C() {
System.out.println ("Constructing C.");
}
}
class OrderOfConstruction {
public static void main (String args[]) {
C c = new C();
}
}
and i got this output:
Constructing A.
Constructing B.
Constructing C.
but if i changed my codes to:
// create a super class
class A {
A() {
System.out.println ("Constructing A. ");
}
}
// create a subclass by extending C
class B extends C {
B() {
System.out.println ("Constructing B.");
}
}

// create a subclass by extending A
class C extends A {
C(){
System.out.println ("Constructing C.");
}
}
class OrderOfConstruction {
public static void main (String args[]) {
C c = new C();
}
}
and i got this output:

Constructing A.
Constructing C.

why "Constructing B." is not showing? do i have
to put in order (A, B, C) not (A, C, B)?
Please help me. Thanks.
19 years ago
thanks William.

"I think Willims is right."(at least this time)
19 years ago
can you show me how to fix that?
thank you so much!
fan
19 years ago
hi, i was trying to do temp. conver from f to c.
here is my part of my code. please help me.
/* Insert the method's description here.
* @param e java.awt.event.ActionEvent
*/
public void actionPerformed(ActionEvent e)
{
if (e.getSource() == calcul)
calculate(fahTF.getText());

if(e.getSource() == reset)
{
fahTF.setText("");
celTF.setText("");
}
}
/**
* Insert the method's description here.
*/
public void calculate(double fah, double cel)
{

???
cel = (5/9 * (fah - 32));

}
and i got this compile error:
FrameTest2.java [78:1] calculate(double,double) in FrameTest2 cannot be applied to (java.lang.String)calculate(fahTF.getText());

thanks in advance.
fan
19 years ago