2013年3月5日
摘要: public class Example4_10{public static void main(String[] args){people zhang=new people();System.out.printf("面积:"+zhang.getArea(10,8.88));System.out.printf("面积: "+zhang.getArea(2.90,10));}}class people{double getArea(int x,double y){return x*y;}int getArea(double x,int y){return 阅读全文
posted @ 2013-03-05 22:03 zhangqiang618 阅读(325) 评论(0) 推荐(0) 编辑
摘要: class Point{double x,y,z; Point(double _x, double _y, double _z){x=_x;y=_y;z=_z;}double getDistance(Point p){return (x-p.x)*(x-p.x)+(y-p.y)*(y-p.y)+(z-p.z)*(z-p.z);}}public class TestPoint{public static void main(String[] args){Point p=new Point(1.0,2.0,3.0);Point p1=new Point(0.0,0.0,0.0);System.ou 阅读全文
posted @ 2013-03-05 21:53 zhangqiang618 阅读(270) 评论(0) 推荐(0) 编辑
摘要: import java.util.*;public class Test2{public static void main(String[] args){Scanner reader=new Scanner(System.in);long product = 1;int a=0;while(reader.hasNextInt()){int x=reader.nextInt();a=a+1;product=product*x;}System.out.printf(a+"个数乘积为"+product);}} 阅读全文
posted @ 2013-03-05 19:24 zhangqiang618 阅读(730) 评论(0) 推荐(0) 编辑
摘要: 这个跟字节编码有关首先知道byte是一个字节保存的,有8个位,也就是8个0、1。8个位的第一个位是符号位,也就是说0000 0001代表的是数字11000 0000代表的就是-1所以正数最大位0111 1111,也就是数字127负数最大为1111 1111,也就是数字-128 阅读全文
posted @ 2013-03-05 18:48 zhangqiang618 阅读(351) 评论(0) 推荐(0) 编辑
摘要: (1)系统环境path的设置:对于windows操作系统,右击“我的电脑”,选择“属性”,在“系统特性”对话框中选择“高级属性”,单击“环境变量”添加系统环境变量。(2)系统环境classpath的设置 阅读全文
posted @ 2013-03-05 18:27 zhangqiang618 阅读(168) 评论(0) 推荐(0) 编辑