Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java×÷Òµ02

package homework02;
import java.util.Scanner;
/*
* ±àдÁ½¸öÀࣺAºÍB£¬ÀàA´´½¨µÄ¶ÔÏó¿ÉÒÔ¼ÆËãÁ½¸öÕýÕûÊýµÄ×î´ó¹«Ô¼Êý£¬ÀàB´´½¨µÄ
* ¶ÔÏó¿ÉÒÔ¼ÆËãÁ½¸öÊýµÄ×îС¹«±¶Êý¡£ÒªÇó£ºÀàBÖÐÓÐÒ»¸ö³ÉÔ±±äÁ¿Ê±ÓÃÀàAµÄÉùÃ÷¶ÔÏó¡£
*/
public class A {
private int m;
private int n;
public A(){
this.intput();
}
//ÊäÈëÁ½¸öÕûÊý
public void intput(){
Scanner s=new Scanner(System.in);
System.out.println("ÇëÊäÈëÄãÏëÒªËãµÄÊý×Ö : ");
m=s.nextInt();
n=s.nextInt();
}

public int zdGYS(int m,int n){
int r;
do
{
if(m<n)
{
int t=m;
m=n;
n=t;
}
r=m%n;
m=n;
n=r;
}while(r!=0);
return m;
}

public void display1(){
System.out.println("×î´ó¹«ÒòÊýÊÇ£º"+zdGYS(m,n));
}

public int getM() {
return m;
}
public int getN() {
return n;
}
public static void main(String args[]){
A a=new A();
a.display1();
new B(a).display2();
}
}

package homework02;
public class B {
private A a;
public B(A a){
this.a=a;
}
public void display2(){
int total=a.getM()*a.getN();
System.out.println("×îС¹«±¶ÊýÊÇ£º"+ total/a.zdGYS(a.getM(), a.getN()));
}
}


Ïà¹ØÎĵµ£º

javaѧϰ±Ê¼Ç 2.»ù±¾Êý¾ÝÀàÐÍ

1.ÕûÊý
byte    1×Ö½Ú
short   2×Ö½Ú
int      4×Ö½Ú
long    8×Ö½Ú
2.¸¡µã
float
double
Ìáʾ
£¨1£© ¸¡µãÐ͵ÄÖµ£¬Èç¹ûûÓÐÌرðÖ¸Ã÷£¬Ä¬ÈÏÊÇ double Ð͵Ä
£¨2£© ¶¨Òå float Ð͵Äʱºò£¬Ò»¶¨ÒªÖ¸Ã÷ÊÇ float Ð͵ģ¬¿ÉÒÔͨ¹ýÔÚÊý×ÖºóÃæÌí¼Ó&rd ......

javaµÄ·´Éä»úÖÆ

JAVAÓïÑÔÖеķ´Éä»úÖÆ£º
    ÔÚJava ÔËÐÐʱ »·¾³ÖУ¬¶ÔÓÚÈÎÒâÒ»¸öÀ࣬ÄÜ·ñÖªµÀÕâ¸öÀàÓÐÄÄЩÊôÐԺͷ½·¨£¿
    ¶ÔÓÚÈÎÒâÒ»¸ö¶ÔÏó£¬ÄÜ·ñµ÷ÓÃËûµÄ·½·¨£¿ÕâЩ´ð°¸Êǿ϶¨µÄ£¬ÕâÖÖ¶¯Ì¬»ñÈ¡ÀàµÄÐÅÏ¢£¬ÒÔ¼°¶¯Ì¬µ÷ÓÃÀàµÄ·½·¨µÄ¹¦ÄÜÀ´Ô´ÓÚJAVAµÄ·´Éä¡£´Ó¶øʹjava¾ßÓж¯Ì¬ÓïÑÔµÄÌØÐÔ¡£
  JAVA·´É ......

JAVAÁ¬½ÓÊý¾Ý¿â Oracle

±¾ÎÄÊ×ÏȽéÉÜjavaÁ¬½ÓoracleҪעÒâµÄ¼¸µã£¬È»ºó½éÉܼ¸ÖÖ³£ÓõÄÁ¬½Ó·½Ê½¡£
Ò»¡¢¼¸µã×¢Ò⣺
1¡¢ÔÚ¿Í»§¶ËÈí¼þ¿ª·¢ÖÐʹÓÃThinÇý¶¯³ÌÐò
     ÔÚ¿ª·¢JavaÈí¼þ·½Ã棬OracleµÄÊý¾Ý¿âÌṩÁËËÄÖÖÀàÐ͵ÄÇý¶¯³ÌÐò£¬¶þÖÖÓÃÓÚÓ¦ÓÃÈí¼þ¡¢applets¡¢servletsµÈ¿Í»§¶ËÈí¼þ£¬ÁíÍâ¶þÖÖÓÃÓÚÊý¾Ý¿âÖеÄJava´æ´¢¹ý³ÌµÈ·þÎñÆ ......

»ñÈ¡javaµÄ·¾¶

¶ÔÓÚJava³ÌÐò£¬ÎÞÂÛÊÇδ´ò°üµÄ»¹ÊÇ´ò°üµÄJAR»òWARÎļþ£¬ÓÐʱºò¶¼ÐèÒª»ñÈ¡ËüÔËÐÐËùÔÚĿ¼ÐÅÏ¢£¬ÈçºÎ×öµ½ÕâÒ»µãÄØ£¿
ÔÚJava´¦ÀíµÄÎļþϵͳÖУ¬Ä¿Â¼µÄ±íʾ·½Ê½ÓÐÁ½ÖÖ£º
£¨1£©¾ø¶ÔĿ¼£¬ËüÒÔ"/"ΪÆðʼ×Ö·û£¬´ú±í´Ó¸ùĿ¼Ï¿ªÊ¼Ñ°ÕÒ¸ø³öµÄĿ¼£¬Èç/c:/java
£¨2£©Ïà¶Ô·¾¶£¬ËüÒÔ²»´ø“/”µÄĿ¼Ãû±íʾ£¬±íʾÒÔµ±Ç ......

JAVAÍøÂçÓ¦ÓÃϵͳ¿ª·¢µÄÐÂ˼¿¼·½·¨

ÄãÒ²ÐíÊÇÒ»¸ö¹¤³Ìʦ£¬ÕýÔÚʹÓÃEJB¡¢Struts¡¢Hibernate¡¢SpringµÈ¸÷ÖÖ¹úÍâÁ÷ÐеĿò¼Ü¿ª·¢ÄãµÄϵͳÖеĸ÷¸ö²¿·Ö£¬ËüÃÇÖ®¼ä¿¿²»Í¬µÄÅäÖÃÎļþ¡¢½Ó¿Ú¡¢·þÎñÁ¬½ÓÔÚÒ»Æð£¬ÎªÕâЩ½Ó¿Ú¡¢ÅäÖᢷþÎñµÄ±àд¡¢µ÷Óã¬Í·ÌÛÂð£¿
ÄãÒ²ÐíÊÇÒ»¸öPM£¬ ÕýÔÚΪÄãµÄÏîÄ¿²ÉÓÃʲô¿ò¼Ü¡¢ÈçºÎ·Ö×é¡¢ÈçºÎЭµ÷¡¢¸÷ÖÖ¿ò¼ÜµÄÓÅÁÓ×öÆÀ¹À¡¢²âÊÔ£¬ÎªÄãµÄÓ¦Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ