摘要: package com.imooc.info; public class Subject { // 成员属性:学科名称、学科编号、学制年限、报名选修的学生信息、报名选修的学生个数 private String SubName; private String SubNo; private int Su 阅读全文
posted @ 2018-01-22 17:48 振华213 阅读(499) 评论(0) 推荐(0) 编辑
摘要: package com.imooc.monkey; public class Monkey { // 属性:姓名(name)、特征(feature) String name; String feature; // 无参的构造方法(默认初始化name和feature的属性值,属性值参考效果图) public Monkey() { System.out.println... 阅读全文
posted @ 2018-01-17 20:34 振华213 阅读(448) 评论(0) 推荐(0) 编辑
摘要: import java.util.Scanner; public class Demo { // 插入数据方法 public int[] insertData() { int[] a = new int[10]; Scanner sc = new Scanner(System.in); for (int i = 0; i =... 阅读全文
posted @ 2018-01-08 22:05 振华213 阅读(162) 评论(0) 推荐(0) 编辑
摘要: package com.imooc.method; public class MathDemo { //求两个int类型数的和 public int plus(int m,int n){ return m+n; } //求两个dounle类型数的和 public double plus(double m,double n){ return m+n; } //求数组元... 阅读全文
posted @ 2018-01-07 20:41 振华213 阅读(1366) 评论(0) 推荐(0) 编辑
摘要: package com.imooc.method; import java.util.Scanner; public class ArraySearch { //查找数组元素值的方法 public boolean search(int n,int[] arr){ boolean flag=false;//默认是没找到 for(int i=0;i<arr.length;i++){ ... 阅读全文
posted @ 2018-01-07 20:14 振华213 阅读(644) 评论(0) 推荐(0) 编辑
摘要: package com.imooc.method; public class AverageDemo { //求数组元素的平均值 public float average(float[] a){ float count=0; for(int i=0;i<a.length;i++){ count=count+a[i]; } float ping=count/a.leng... 阅读全文
posted @ 2018-01-05 21:50 振华213 阅读(1085) 评论(0) 推荐(0) 编辑
摘要: package com.imooc.method; public class PrintArrayDemo { //定义方法,打印输出数组元素的值 public void printArray(int[] arr){ for(int i=0;i<arr.length;i++){ System.out.println(arr[i]+" "); } System.out.pr... 阅读全文
posted @ 2018-01-05 21:16 振华213 阅读(667) 评论(0) 推荐(0) 编辑
摘要: 1!+2!+3!+4!+5!=153 阅读全文
posted @ 2018-01-05 20:51 振华213 阅读(367) 评论(0) 推荐(0) 编辑
摘要: package com.imooc.method; import java.util.Scanner; public class CountDemo { //根据商品总价输出折后总价 public void count(float a){ float value; if(a=100&a<199){ value=a*0.95f; }else{ value=a*0.8... 阅读全文
posted @ 2018-01-05 20:28 振华213 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 两个数5.0和3.0的最大值为5.0两个数5.6和8.9的最大值为8.9两个数9.8和12.8的最大值为12.8 阅读全文
posted @ 2018-01-05 20:16 振华213 阅读(511) 评论(0) 推荐(0) 编辑