文章分类 -  java

异常处理
摘要:1 package com.unit12.test; 2 3 public class test1 { 4 5 public static void main(String[] args) { 6 int[] arry= {12,22,43,33,134,35,0,78,67,88,8}; 7 8 阅读全文

posted @ 2020-06-22 21:49 cherry_ning 阅读(68) 评论(0) 推荐(0)

面向对象进阶--接口、多态
摘要:接口: 1 package com.unit10.test; 2 3 //属性是全局静态常量 4 //方法必须是public抽象方法 5 //没有构造方法 6 //无法实例化 7 public interface Mp3 { 8 String discrib="这是MP3接口"; 9 10 publ 阅读全文

posted @ 2020-06-21 16:25 cherry_ning 阅读(78) 评论(0) 推荐(0)

面向对象进阶--私有属性/方法、继承、四中访问修饰符、抽象类
摘要:1 package com.unit6.test; 2 3 public class Dog { 4 private String name; //私有属性,不可以被外部直接访问 5 private String pwd; 6 private int age; 7 8 public int getA 阅读全文

posted @ 2020-06-21 15:39 cherry_ning 阅读(131) 评论(0) 推荐(0)

面向对象基础-例子
摘要:1 package com.caiquan.pojo; 2 3 import java.util.Scanner; 4 5 public class Person { 6 String name="小明"; 7 int score; 8 9 public int getScore() { 10 re 阅读全文

posted @ 2020-06-16 20:41 cherry_ning 阅读(50) 评论(0) 推荐(0)

面向对象基础
摘要:1 package com.unit5.pojo; 2 3 public class Dog { 4 //定义类的属性 5 String name; 6 String color; 7 int age; 8 9 //定义构造方法 10 public Dog(String name,String co 阅读全文

posted @ 2020-06-16 20:31 cherry_ning 阅读(79) 评论(0) 推荐(0)

方法
摘要:1 package com.unit4.test; 2 3 public class Test1 { 4 5 //返回修饰符public:项目中任何地方都可以调用 6 //返回值类型void:无返回值 7 //方法名function1:驼峰命名 8 //()中写参数列表,可以省略 9 //stati 阅读全文

posted @ 2020-06-12 20:59 cherry_ning 阅读(83) 评论(0) 推荐(0)

排序
摘要:1 package com.unit3.test; 2 3 public class Test8 { 4 5 public static void main(String[] args) { 6 int[] a= {14,2,454,5,1}; 7 8 // 冒泡排序 9 // for(int i= 阅读全文

posted @ 2020-06-08 22:58 cherry_ning 阅读(52) 评论(0) 推荐(0)

数组
摘要:1 package com.unit3.test; 2 3 public class Test1 { 4 5 public static void main(String[] args) { 6 // 动态初始化 7 int[] a=new int[5]; 8 a[0]=2; 9 a[1]=2; 1 阅读全文

posted @ 2020-06-07 19:34 cherry_ning 阅读(74) 评论(0) 推荐(0)

控制结构综合案例
摘要:1 package com.unit2.test; 2 3 import java.util.Scanner; 4 5 public class Test10 { 6 7 public static void main(String[] args) { 8 // 模拟ATM机 9 Scanner i 阅读全文

posted @ 2020-06-03 21:48 cherry_ning 阅读(130) 评论(0) 推荐(0)

循环结构-while、do-while、for、continue/break
摘要:1 package com.unit2.test; 2 3 import java.util.Scanner; 4 5 public class Test1 { 6 7 public static void main(String[] args) { 8 // while循环 9 // int i= 阅读全文

posted @ 2020-06-03 19:37 cherry_ning 阅读(174) 评论(0) 推荐(0)

if、switch选择结构/字符串判断相等/获取随机数/数字相除处理
摘要:1 package com.unit1.test; 2 3 import java.util.Scanner; 4 5 public class Test5 { 6 7 public static void main(String[] args) { 8 //if结构 9 Scanner input 阅读全文

posted @ 2020-06-01 19:38 cherry_ning 阅读(226) 评论(0) 推荐(0)

变量、数据类型、操作符
摘要:1 package com.unit1.test; 2 3 /** 4 * 5 * @author ASUS 6 * hdhdhdhdhdh 7 */ 8 9 public class Test1 { 10 11 /*hahhahah*/ 12 public static void main(Str 阅读全文

posted @ 2020-05-30 17:50 cherry_ning 阅读(80) 评论(0) 推荐(0)

导航