·¢²¼Ê±¼ä : ÐÇÆÚÁù ÎÄÕÂJavaÃæÏò¶ÔÏó±à³ÌÁ·Ï°Ìâ´ð°¸0¸üÐÂÍê±Ï¿ªÊ¼ÔĶÁ26c21c57c4da50e2524de518964bcf84b9d52d8c
\ } }
public class b01 {
public static void main(String args[]){ NetUser user = new NetUser(\ user.output(); } }
¡¾Á·Ï°Ìâ¡¿10.¹¹Ôì·½·¨ÓëÖØÔØ¡¢°ü
±àдAdditionÀ࣬¸ÃÀàÖÐÓ¦°üº¬Ò»×éʵÏÖÁ½ÊýÏà¼ÓÔËËãµÄÖØÔØ·½·¨¡£ ʵÏÖ¼Ó·¨ÔËËãµÄ·½·¨£¬Ó¦½ÓÊÜÁ½¸ö²ÎÊý£¨¼´¼ÓÊýºÍ±»¼ÓÊý£©£¬·½·¨½«Á½¸ö²ÎÊý½øÐмӷ¨ÔËËãºó£¬·µ»ØÏà¼Ó½á¹û¡£¿¼ÂÇ¿ÉÄÜÕë¶Ô²»Í¬µÄÊý¾ÝÀàÐͽøÐмÆË㣬ÖØÔØÒ»×é·½·¨£¬°üÀ¨ÕûÐÍ¡¢³¤ÕûÐÍ¡¢¸¡µãÐÍ¡¢Ë«¾«¶È¸¡µãÐÍ¡¢»¹ÓÐ×Ö·û´®¡£ ÔÚmain·½·¨Öд´½¨AdditionÀàµÄʵÀý£¬·Ö±ðµ÷ÓÃÖØÔØ·½·¨²âÊÔÆäЧ¹û¡£ Ó¦½«AdditionÀà´òÈëµ½°üÖУ¬ÒÔ×Ô¼ºÃû×ÖµÄÆ´ÒôΪ°üÃüÃû¡£ package yan.cong; class Addition{
public Addition(){ }
void add(int a,int b){ int c = a+b;
System.out.println(\}
void add(long a,long b){ long c = a+b;
System.out.println(\ }
void add(float a,float b){ float c = a+b;
System.out.println(\ }
void add(double a,double b){ double c = a+b;
System.out.println(\ }
void add(String a,String b){ String c = a+b;
System.out.println(\ } }
public class b01
{
public static void main(String args[]){ Addition m = new Addition(); Addition n = new Addition(); m.add(5,6); n.add(\ } }
¡¾Á·Ï°Ìâ¡¿11.¹¹Ôì·½·¨ÓëÖØÔØ
½«ÉÏ´ÎÁ·Ï°ÌâÈýÖбàдµÄMyTimeÀà´òµ½ÒÔ×Ô¼ºÃû×ÖµÄÆ´ÒôÃüÃûµÄ°üÖУ¬²¢Îª¸ÃÀàÖØÔØÒ»×é¹¹Ôì·½·¨£¬ÒÔ·½±ãʹÓÃÕßÄܹ»ÒÔ¶àÖÖÐÎʽ³õʼ»¯¸ÃÀàµÄʵÀý¡£ package yan.cong; class MyTime {
private int hour; private int minute; private int second;
public MyTime(int hour,int minute,int second){ this.hour = hour; this.minute = minute; this.second = second; }
public MyTime(int minute,int second){ this.minute = minute; this.second = second; }
void diaplay(){
System.out.println(\ʱ¼ä£º\ ); }
void addSecond(int sec){ second = second+sec; }
void addMinute(int min){ minute = minute+min; }
void addHour(int hou){ hour = hour+hou; }
void subSecond(int sec){ second = second-sec; }
void subMinute(int min){ minute = minute-min;
}
void subHour(int hou){ hour = hour-hou; }
void Test(){
if(hour<=23&hour>=0&minute<=59&minute>=0&second<=59&second>=0) System.out.println(\ else System.out.println(\ } }
public class b01 {
public static void main(String args[]){ MyTime b = new MyTime(11,4,55); b.subHour(5); b.subMinute(5); b.subSecond(2); b.diaplay(); b.Test(); } }
¡¾Á·Ï°Ìâ¡¿12.¹¹Ôì·½·¨ÓëÖØÔØ
½¨Á¢Ò»¸öÆû³µÀ࣬°üÀ¨ÂÖÌ¥¸öÊý£¬Æû³µÑÕÉ«£¬³µÉíÖØÁ¿µÈÊôÐÔ¡£²¢Í¨¹ý²»Í¬µÄ¹¹Ôì·½·¨´´½¨ÊÂÀý¡£
ÖÁÉÙÒªÇó£ºÆû³µÄܹ»¼ÓËÙ£¬¼õËÙ£¬Í£³µ¡£
ÒªÇó£ºÃüÃû¹æ·¶£¬´úÂëÌåÏÖ²ã´Î£¬ÓÐÓѺõIJÙ×÷Ìáʾ¡£ class Car {
private int tires; private String color; private int load;
public Car(int tires){ this.tires = tires; System.out.println(\ÂÖÌ¥¸öÊý£º\ }
public Car(String color){ this.color = color; System.out.println(\Æû³µÑÕÉ«£º\ }
public Car(int tires,String color,int load){ this(tires); this.color = color; System.out.println(\Æû³µÑÕÉ«£º\
this.load = load; System.out.println(\Æû³µÖØÁ¿£º\ }
void upSpeed(){ System.out.println(\³µÕýÔÚ¼ÓËÙ\ }
void downSpeed(){ System.out.println(\³µÕýÔÚ¼õËÙ\ }
void stop(){ System.out.println(\³µÒѾֹͣÁË\ } }
public class b01 {
public static void main(String args[]){ Car a = new Car(6); Car b = new Car(4,\°×É«\ a.upSpeed(); b.stop(); } }
¡¾Á·Ï°Ìâ¡¿13.¹¹Ôì·½·¨ÓëÖØÔØ
´´½¨Ò»¸öÀ࣬Ϊ¸ÃÀඨÒåÈý¸ö¹¹Ô캯Êý£¬·Ö±ðÖ´ÐÐÏÂÁвÙ×÷£º 1¡¢´«µÝÁ½¸öÕûÊýÖµ²¢ÕÒ³öÆäÖнϴóµÄÒ»¸öÖµ 2¡¢´«µÝÈý¸ödoubleÖµ²¢Çó³öÆä³Ë»ý 3¡¢´«µÝÁ½¸ö×Ö·û´®Öµ²¢¼ì²éÆäÊÇ·ñÏàͬ 4¡¢ÔÚmain·½·¨ÖвâÊÔ¹¹Ô캯ÊýµÄµ÷Óà class Check {
public Check(int a ,int b){ int c=Math.max(a,b);
System.out.println(\½Ï´óֵΪ£º\ }
public Check(double a,double b,double c){ double d = a*b*c; System.out.println(\ }
public Check(String a,String b){ boolean c = a.equals(b);
System.out.println(\Á½×Ö·û´®ÏàµÈ£º\ }