Would you like to react to this message? Create an account in a few clicks or log in to continue.

ʹ Interface ͧ public abstrac ҹ

Go down

ʹ Interface ͧ public  abstrac ҹ Empty ʹ Interface ͧ public abstrac ҹ

ตั้งหัวข้อ  Admin Wed May 21, 2008 2:28 pm

package Interface;

interface IPERSON {

// public static final ҹ
public static int age =100;

// public abstract ҹ Default
String ShowName();
String ShowAge();

}




public class Person implements IPERSON {

/// ѧࡵ ѹͧ public interface ѧѺ
public String ShowAge() {
System.out.println( " ShowAge() : "+(age)); // ++age ѹ Final
return null;
}

public String ShowName() {
// System.out.println("ShowName() : "+(++age)); // age ѹ Final
return null;
}


static public void main(String [] a) {

new Person().ShowAge();
new Person().ShowName();
}

}
Admin
Admin
Admin

จำนวนข้อความ : 112
Registration date : 18/05/2008

http://chawban.chocoforum.com

ขึ้นไปข้างบน Go down

ʹ Interface ͧ public  abstrac ҹ Empty Re: ʹ Interface ͧ public abstrac ҹ

ตั้งหัวข้อ  Admin Wed May 21, 2008 2:41 pm


package Interface;

interface IPERSON {

// public static final ҹ
public static int age =100;

// public abstract ҹ Default
String ShowName();
String ShowAge();

}






public class Person implements IPERSON {

/// ѧࡵ ѹͧ public interface ѧѺ
public String ShowAge() {
System.out.println( " ShowAge() : "+(age)); // ++age ѹ Final
return null;
}

public String ShowName() {
// System.out.println("ShowName() : "+(++age)); // age ѹ Final
return null;
}


static public void main(String [] a) {

new Person().ShowAge();
new Person().ShowName();
}

}
Admin
Admin
Admin

จำนวนข้อความ : 112
Registration date : 18/05/2008

http://chawban.chocoforum.com

ขึ้นไปข้างบน Go down

ขึ้นไปข้างบน

- Similar topics

 
Permissions in this forum:
คุณไม่สามารถพิมพ์ตอบ