摘要:
方法的重写(重点) 重写:需要有继承关系,子类重写父类的方法! 1.方法名必须相同 2.参数列表必须系统 3.修饰符:范围可以扩大但不能缩小:public>protected>default>private 4.抛出的异常:范围,可以被缩小,但不能扩大:ClassNotFoundException- 阅读全文
posted @ 2020-12-17 22:05
XC666
阅读(108)
评论(0)
推荐(0)
摘要:
继承 super详解 package oop; //import oop.demo04.Student; import oop.D5.Student; public class Application { public static void main(String[] args) { // Stu 阅读全文
posted @ 2020-12-17 22:03
XC666
阅读(156)
评论(0)
推荐(0)
摘要:
封装详解 package oop.demo04; public class Student { private String name; private int id; private char sex; private int age; //提供一些可以操作这个属性的方法 //提供一些public 阅读全文
posted @ 2020-12-17 22:00
XC666
阅读(539)
评论(0)
推荐(0)
摘要:
类与对象的关系 package oop.demo02; //学生类 public class Student { //属性“字段 String name;//默认是null int age;//默认0 //方法 public void study(){ System.out.println((thi 阅读全文
posted @ 2020-12-17 21:58
XC666
阅读(104)
评论(0)
推荐(0)
摘要:
回顾方法的定义 package oop; public class Demo01 { //main方法 public static void main(String[] args) { } /* 修饰符 返回值类型 方法名(...){ //方法体 return 返回值; } */ public St 阅读全文
posted @ 2020-12-17 21:56
XC666
阅读(52)
评论(0)
推荐(0)
摘要:
数组工具类 冒泡排序: package array; import java.lang.reflect.Array; import java.util.Arrays; public class Demo03 { public static void main(String[] args) { int 阅读全文
posted @ 2020-12-17 21:42
XC666
阅读(139)
评论(0)
推荐(0)
摘要:
内存分析 数组的四个特点 反转数组: package array; public class demo02 { public static void main(String[] args) { int []arrays={1,2,3,4,5}; int []reverse=reverse(array 阅读全文
posted @ 2020-12-17 21:40
XC666
阅读(91)
评论(0)
推荐(0)
摘要:
数组是什么 数组声明和创建 package array; public class demo01 { public static void main(String[] args) { int []nums1;//1.声明一个数组 int nums2[];//不推荐 nums=new int[10]; 阅读全文
posted @ 2020-12-17 21:38
XC666
阅读(131)
评论(0)
推荐(0)
摘要:
package methods; public class Demo01 { //main方法 public static void main(String[] args) { double max=max(20.0,10.0); System.out.println(max); } //比大小 p 阅读全文
posted @ 2020-12-17 21:35
XC666
阅读(84)
评论(0)
推荐(0)
摘要:
什么是方法 0 package methods; public class Demo01 { //main方法 public static void main(String[] args) { int max=max(20,10); System.out.println(max); } //比大小 阅读全文
posted @ 2020-12-17 21:33
XC666
阅读(128)
评论(0)
推荐(0)