随笔分类 -  Java基础

java的基础知识点
摘要:javadoc 帮助文档书写 public class JavaDoc{ /** * @author xiaowen * @param args * @since 1.0 * @throws null */ public static void main(String[] args){ System 阅读全文
posted @ 2022-10-23 17:06 Always_0708 阅读(13) 评论(0) 推荐(0) 编辑
摘要:抽象类 public abstract class Action { public abstract void test01(); } public class Wecome extends Action { @Override public void test01() { } } 注意事项: 1. 阅读全文
posted @ 2022-10-21 00:59 Always_0708 阅读(22) 评论(0) 推荐(0) 编辑
摘要:static 代码块 package com.beijing.xiaowen.oop; public class TestStatic { //初始数据源 { System.out.println("匿名代码快"); } //在加载类得时候,只执行一次 static { System.out.pri 阅读全文
posted @ 2022-10-21 00:50 Always_0708 阅读(18) 评论(0) 推荐(0) 编辑
摘要:继承 重写 多态 super super注意点: 1. super调用父类的构造方法,必须在构造方法的第一个 2. super 必须只能出现在子类的构造方法或方法中 3. super和this 不能同时调用构造方法 VS this: 代表的对象不同: this: 本身调用者这个对象 super: 代 阅读全文
posted @ 2022-10-21 00:02 Always_0708 阅读(20) 评论(0) 推荐(0) 编辑
摘要:面向对象 构造器 构造器:1、和类名同名 2、没有返回值 package com.beijing.xiaowen.oop; public class Person { int age; String name; //默认构造器,一般都存在 //使用new关键字,本质是构造器 //无参构造器作用: / 阅读全文
posted @ 2022-10-20 23:41 Always_0708 阅读(14) 评论(0) 推荐(0) 编辑
摘要:package com.beijing.xiaowen.Array; import java.util.Arrays; public class Test01 { public static void main(String[] args) { //冒泡排序 int[] abc = {3,5,1,6 阅读全文
posted @ 2022-10-20 02:25 Always_0708 阅读(11) 评论(0) 推荐(0) 编辑
摘要:可变参数 package com.beijing.xiaowen.methods; public class Demo01 { public static void main(String[] args) { method01(1,2,4,1); } //可变参数,即在参数类型后 用... 表示 / 阅读全文
posted @ 2022-10-20 00:58 Always_0708 阅读(13) 评论(0) 推荐(0) 编辑
摘要:用户交互Scanner package com.beijing.xiaowen.scanner; import java.util.Scanner; public class Demo01 { public static void main(String[] args) { //接受键盘输入内容 S 阅读全文
posted @ 2022-10-19 23:10 Always_0708 阅读(15) 评论(0) 推荐(0) 编辑
摘要:基本运算符 package com.beijing.xiaowen.operator; public class Demo01 { public static void main(String[] args) { int a = 10; int a1 = 20; int a2 = 30; int a 阅读全文
posted @ 2022-10-19 01:22 Always_0708 阅读(30) 评论(0) 推荐(0) 编辑
摘要:变量 public class WithZVariable { //类变量 static int abc = 66; //实例变量 从属于对象;如果不自行初始化,这个类型默认值为 0 0.0 //布尔值:默认是false //除了基本类型 其余都是null String abv = "zhou"; 阅读全文
posted @ 2022-10-19 00:29 Always_0708 阅读(17) 评论(0) 推荐(0) 编辑
摘要:public class TypeConversion { public static void main(String[] args) { /** * 低 高 * byte short char int long float double * */ int a = 128; byte b = (b 阅读全文
posted @ 2022-10-19 00:05 Always_0708 阅读(19) 评论(0) 推荐(0) 编辑
摘要:public class BasicSyntax { public static void main(String[] args) { System.out.println("laoliu"); /** * 八大基本数据类型 * */ //整数 int num1 = 10; byte num2 = 阅读全文
posted @ 2022-10-18 23:49 Always_0708 阅读(17) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示