Java SE ½Ó¿Ú¡¢³éÏóÀà
package demo;
interface Runner{
int ID=1;
void run();
void fly();
}
abstract class AI implements Runner{
public void run(){
System.out.println("I am running");
}
public void bb(int x,int y){
System.out.println((x+y));
}
abstract void breathy();
}
public class TestInterface extends AI /*implements Runner*/{
/**
* @param args
*/
public static void main(String[] args) {
// TODO ×Ô¶¯Éú³É·½·¨´æ¸ù
TestInterface ti=new TestInterface();
ti.run();
ti.breathy();
ti.fly();
ti.bb(1, 2);
}
void breathy() {
System.out.println("I am breathing");
}
public void fly() {
System.out.println("I am flying");
}
}
Ïà¹ØÎĵµ£º
/**
* ±£ÁôÁ½Î»Ð¡Êý
* @param d
* @return
*/
private static double remainTwoNumbers(double d){
java.math.BigDecimal f1 = new java.math.BigDecimal(d);//СÊýµãºó±£Áô2Î ......
±¨Îļø±ðÔÚÉí·ÝÈÏÖ¤ÖÐÕ¼ÖØÒªÎ»Öã¬ÊÇÈÏ֤ϵͳµÄÒ»¸öÖØÒª»·½Ú£¬ÔÚ½ðÈÚºÍÉÌҵϵͳÖй㷺ӦÓá£
±¨Îļø±ð³£Óñ¨Îļø±ðÂ루Message Authentication Code,¼´MAC£©×÷Ϊ¼ø±ðµÄ»ù´¡£¬
......
import java.lang.reflect.*;
public class ReflectTester {
public Object copy(Object object) throws Exception{
//»ñµÃ¶ÔÏóµÄÀàÐÍ
Class classType=object.getClass();
System.out.println("Class:"+classType.getName());
//ͨ¹ýĬÈϹ¹Ôì·½·¨´´½¨Ò»¸öеĶÔÏó
Object objectCo ......
ÒªÀíÀà¼ÓÔØÌåϵ½á¹¹£¬¾Í±ØÐëÇå³þÈçϼ¸µã±È½Ï»ù±¾µÄÔÔò:
1. classLoaderÊÇÒ»ÖÖ¸¸×ÓÊ÷Ðνṹ£¨×¢£ºÕâÀï²»ÊÇÖ¸Àà¼Ì³ÐµÄ¸¸×Ó¹ØÏµ£©
2. ¸¸classLoaderÎÞ·¨¿´µ½×ÓclassLoader¼ÓÔØµÄÀà
3¡¢ÐéÄâ»ú×ñÊØË«Ç×ίÍмÓÔØÔÔò£¬¼´ÈκÎ×ÓclassLoaderÐëÊ×ÏÈίÍи¸classLoaderÏȼÓÔØÐèÒªµÄÀ࣬µ±¸¸classLoader¼ÓÔØ²»µ½Ê±ÔÙÓÉ×ÓclassLoa ......
E:\>javac -X
-Xlint ÆôÓý¨ÒéµÄ¾¯¸æ
-Xlint:{all,deprecation,unchecked,fallthrough,path,serial,finally,-deprecat ion
,-unchecked,-fallthrough,-path,-serial,-finally}ÆôÓûò½ûÓÃÌØ¶¨µÄ¾¯¸æ
& ......