Java????????????????????
???????????? ???????[ 2013/1/25 9:45:48 ] ????????
???????java?е?????????????????????
//??????
public abstract class AExample
{
public abstract int add(int x??int y);
public abstract int sub(int x??int y);
}
//???
public interface IExample
{
public int add(int x??int y);
public int sub(int x??int y);
}
??????????÷??????????????????????????????????????????????????ж????????????????????????е????????????
????1?????????????????
public class MyClass extends AExample
{
//??????????壺??
//?????????е??????
public int add(int x??int y)
{
return x+y;
}
public int sub(int x??int y)
{
return x-y;
}
//???????????
}
??????÷?????
AExample ae = new MyClass();
int s = ae.add(4??2);
int t = ae.sub(4??2);
????2??????????????
public class MyClass implements IExample
{
//??????????壺??
//?????????е??????
public int add(int x??int y)
{
return x+y;
}
public int sub(int x??int y)
{
return x-y;
}
//???????????
}
??????÷?????
IExample ae = new MyClass();
int s = ae.add(4??2);
int t = ae.sub(4??2);
??????????????????????????÷??????????????
??????????????????
?????????????????????????????????y????????????????
????1?????????????????????????
????int[] array;
?????????????????array????????????array[0]??array[1]?????????????????????????????????????
????int[] array = new int[]{1??2};
????1??2???????????????“??????”?????array[0]??array[1]???????????array????????
????2?????????????????????????????
AExample ae = new AExample(){
public int add(int x??int y)
{
return x+y;
}
public int sub(int x??int y)
{
return x-y;
}
}??
int s = ae.add(4??2);
int t = ae.sub(4??2);
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11