摘要: public class Homework05 { boolean test (int a){ if(a%2==0){ return true; }else{ return false; } }} import java.util.Scanner; public class Main05 { pub 阅读全文
posted @ 2017-03-26 22:22 我为编程上架构 阅读(956) 评论(0) 推荐(0) 编辑
摘要: public class Homework06 { void test1(int a,int b){ int t ,i,m,n; m=a; n=b; if(a<b){ t=a; a=b; b=t; } while(a%b!=0){ t=a%b; a=b; b=t; } System.out.prin 阅读全文
posted @ 2017-03-26 22:18 我为编程上架构 阅读(427) 评论(0) 推荐(0) 编辑
摘要: public class Homework07 { void test2 (int a){ int t,x=0,i; for(i=1;i<=4;i++){ t=a%10; a=a/10; x=x+t; } System.out.println("四位数的各位数和为"+x); }} import ja 阅读全文
posted @ 2017-03-26 22:17 我为编程上架构 阅读(903) 评论(0) 推荐(0) 编辑
摘要: 郑州大学——徐峰 类方法: public class Homework08 { void test3 (int a){ int t,i,x=0; for(i=1;i<=5;i++){ t=a%10; a=a/10; x=x*10+t; } System.out.print(x); }} 主方法: i 阅读全文
posted @ 2017-03-26 22:15 我为编程上架构 阅读(1295) 评论(0) 推荐(0) 编辑
摘要: 郑州大学——徐峰 类: public class Homework09 { void test3 (int a){ int t,i,x=0,y; y=a; for(i=1;i<=5;i++){ t=a%10; a=a/10; x=x*10+t; } if(x==y){ System.out.prin 阅读全文
posted @ 2017-03-26 22:12 我为编程上架构 阅读(581) 评论(0) 推荐(0) 编辑
摘要: JAVA中类与对象的概念 把客观世界中的事物映射到面向对象的程序设计中就是对象。对象是面向对象程序设计中用来描述客观事物的程序单位。客观世界中的许多对象,无论其属性还是其行为常常有许多共同性,抽象出这些对象的共同性便可以构成类。所以,类是对象的抽象和归纳,对象是类的实例。 一、抽象原则 所谓抽象(a 阅读全文
posted @ 2017-03-26 16:05 我为编程上架构 阅读(226) 评论(0) 推荐(0) 编辑