自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 收藏
  • 关注

原创 时间

时间幻想占用时间,浪费精力,都多大了,还搞这些,实在不合适,之前占比20%,若能戒除,20%时间

2020-09-29 19:59:26 76

原创 写在最前

一个东西,对我有10%的加成,如果坚持一生,那就是10%,坚持一年,那就是0.5%,颠覆性的东西,有100%的加成,哪怕坚持一年,我的人生也能加强5%,那么多东西加起来,增强一倍,就不得了

2020-09-29 19:52:42 118

原创 多态,抽象类,接口

人类public abstract class Person { private String name; private int age; public Person() { } public Person(String name, int age) { this.name = name; this.age = age; } public String getName() { return name;

2020-09-28 16:21:19 125

原创 修饰符,关键字

权限修饰符finallstatic静态成员方法只能访问静态成员class Student { public String name; //姓名 public int age; //年龄 public static String university; //学校 共享数据!所以设计为静态! public void show() { System.out.println(name + "," + age + "," + university);

2020-09-27 18:59:32 114

原创 继承

关键字this(…) - 访问本类构造方法super(…) - 访问父类构造方法方法重写私有方法不能被重写(父类私有成员子类是不能继承的)子类方法访问权限不能更低(public > 默认 > 私有)动物和猫public class Animal { private String name; private int age; public Animal() { } public Animal(String name, int age)

2020-09-27 18:59:09 56

原创 学生管理代码

学生类package SYS_pck;public class Student { private String sid; private String name; public Student() { } public Student(String sid, String name, String age, String address) { this.sid = sid; this.name = name; }

2020-09-26 20:01:19 470

原创 类方法

Random 1:导包 import java.util.Random; 2:创建对象 Random r = new Random(); 3:获取随机数 int number = r.nextInt(10); 获取数据的范围:[0,10) 包括0,不包括10输入字符串Scanner sc = new Scanner(System.in);String s = sc.nextLine();数字Scanner sc = new Scanner(System.in);

2020-09-26 19:55:55 43

原创 类型转换

byte b1 = 10;byte b2 = 20;byte b3 = b1 + b2;// 第三行代码会报错,b1和b2会自动转换为int类型,计算结果为int,int赋值给byte需要强制类型转换。// 修改为:int num = b1 + b2;// 或者:byte b3 = (byte) (b1 + b2);//注意:扩展的赋值运算符底层隐含了强制类型转换 short s = 10; s += 20; //s = (short)(s + 20);boolean类..

2020-09-26 19:55:25 68

原创 运算符

三元int a = 10; int b = 20; //max必须和ab同类 int max = a > b ? a : b;自加//注意:扩展的赋值运算符底层隐含了强制类型转换 short s = 10; s += 20; //s = (short)(s + 20);短路System.out.println((i > j) & (i > k))System.out.println((i > j) && (i >

2020-09-26 19:54:51 49

原创 语句结构

2020-09-26 19:54:17 59

原创 语句结构

switchswitch(month) { case 1: case 2: case 12: System.out.println("冬季"); break; case 3: case 4: case 5: System.out.println("春季"); break; case 6: case 7: case 8: System.out.println("夏季"); break; case 9:

2020-09-26 19:53:45 75

原创 方法

内存重载

2020-09-26 19:52:38 57

原创 API

String创建String s1 = new String();char[] chs = {‘a’, ‘b’, ‘c’};String s2 = new String(chs);byte[] bys = {97, 98, 99};String s3 = new String(bys);String s4 = “abc”;通过构造方法创建 通过 new 创建的字符串对象,每一次 new 都会申请一个内存空间,虽然内容相同,但是地址值不同直接赋值方式创建 以“”方式给出的字符串,只要字符序列

2020-09-26 19:43:06 68

原创 类对象

class Student {//成员变量private String name;private int age;//构造方法public Student() {}public Student(String name, int age) {this.name = name;this.age = age;}//成员方法public void setName(String name) {this.name = name;}public String getName() {retu

2020-09-26 19:40:03 124

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除