摘要:
N种内部类 一 package com.oop.demo10; public class Outer { private int id = 10; public void out(){ System.out.println("这是外部类的方法"); } public class Inner{ pub 阅读全文
posted @ 2021-03-31 11:27
JwStudy
阅读(41)
评论(0)
推荐(0)
摘要:
抽象类(了解) package com.oop.demo08; //abstract 抽象类:类 extends: 单继承 (接口可以多继承) public abstract class Action { //约束 有人帮我们实现 //abstract ,抽象方法,只有方法名字,没有方法的实现! p 阅读全文
posted @ 2021-03-31 11:26
JwStudy
阅读(124)
评论(0)
推荐(0)
摘要:
static关键字详解 package com.oop.demo07; public class Student { private static int age;//静态的变量 多线程! private double score;//非静态的变量 public void run(){ go();/ 阅读全文
posted @ 2021-03-31 11:25
JwStudy
阅读(41)
评论(0)
推荐(0)
摘要:
面向对象三大特性-多态详解 package com.oop; import com.oop.demo06.Person; import com.oop.demo06.Student; public class Application { public static void main(String[ 阅读全文
posted @ 2021-03-31 11:24
JwStudy
阅读(53)
评论(0)
推荐(0)
摘要:
面向对象三大特性-继承 package com.oop; import com.oop.demo05.Student; public class Application { public static void main(String[] args) { Student student = new 阅读全文
posted @ 2021-03-31 11:22
JwStudy
阅读(50)
评论(0)
推荐(0)
摘要:
面向对象 面向对象三大特性-封装 package com.oop; import com.oop.demo04.Student; /* 1.提高程序的安全性,保护数据 2.隐藏代码的实现细节 3.统一接口 4.系统可维护增加了 */ public class Application { public 阅读全文
posted @ 2021-03-31 11:20
JwStudy
阅读(70)
评论(0)
推荐(0)
摘要:
类与对象的创建 类与对象的关系 package com.oop.demo2; //学生类 //类相对于一个模板,对象是一个实例 //学生类是学生的属性(姓名)方法(能干什么) //创建的学生对象是一个具体的学生(有头有脸) public class Student { //属性:字段 String 阅读全文
posted @ 2021-03-31 11:15
JwStudy
阅读(60)
评论(0)
推荐(0)
摘要:
面向对象 什么是面向对象 回顾方法的定义 package com.oop.demo1; import java.io.IOException; //Demo01 类 public class Demo01 { //main方法 public static void main(String[] arg 阅读全文
posted @ 2021-03-31 11:12
JwStudy
阅读(55)
评论(0)
推荐(0)
摘要:
02 数组 数组的声明和创建 package com.kuang.array; public class ArrayDemo01 { //变量的类型 变量的名字 = 变量的值; //数组类型 public static void main(String[] args) { int[] nums;// 阅读全文
posted @ 2021-03-31 11:04
JwStudy
阅读(60)
评论(0)
推荐(0)
摘要:
01 方法 package com.kuang.method; public class Demo01 { //main方法 public static void main(String[] args) { //实际参数:实际调用传递给他的参数 int sum = add(1, 2); System 阅读全文
posted @ 2021-03-31 10:55
JwStudy
阅读(49)
评论(0)
推荐(0)
浙公网安备 33010602011771号