菜鸟的博客

纵有疾风起,人生不言弃。

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

统计

07 2023 档案

2023.7.31 周一:捕获和抛出异常 快捷键:Ctrl+Alt+D
摘要:import java.util.Scanner; //try catch finally throw throws public class Main { public static void main(String[] args) { int a = 1; int b = 0; //捕获多个异常 阅读全文

posted @ 2023-07-31 15:29 hhmzd233 阅读(86) 评论(0) 推荐(0) 编辑

2023.7.29 周五:接口 interface
摘要:1 //1.约束 2 //2.用inteface定义,不可实例化,没有构造方法 3 //3.用implements可实现多个接口 4 5 //接口 6 public interface Service {//用interface定义接口 7 8 //在接口中定义的属性,都是常量 public sta 阅读全文

posted @ 2023-07-29 20:44 hhmzd233 阅读(11) 评论(0) 推荐(0) 编辑

2023.7.28 周五:抽象类 abstract
摘要:1 //不能new抽象类,只能依靠子类去重写来实现 2 //抽象类中可以写普通方法 3 //抽象方法必须写在抽象类中 4 // 5 //person 6 package com.mu.www; 7 8 public abstract class Person {//抽象类 9 public abst 阅读全文

posted @ 2023-07-28 20:52 hhmzd233 阅读(8) 评论(0) 推荐(0) 编辑

2023.7.27 周四:static
摘要:1 public class Student { 2 private int age;//非静态变量 3 private static int score;//静态变量 4 public void run(){ 5 6 } 7 public static void go(){ 8 9 } 10 11 阅读全文

posted @ 2023-07-27 18:36 hhmzd233 阅读(7) 评论(0) 推荐(0) 编辑

2023.7.26 周三:instanceof
摘要:1 /* 2 instancof 判断两个类之间是否有继承关系 3 Object->String 4 Object->Person->Teacher 5 Object->Person->Student 6 */ 7 Object s1 = new Student(); 8 System.out.pr 阅读全文

posted @ 2023-07-26 19:42 hhmzd233 阅读(2) 评论(0) 推荐(0) 编辑

2023.7.25 周二:多态
摘要:1 /* 2 多态注意事项: 3 1.多态是方法的多态,属性没有多态 4 2.父类和子类,有联系,类型转换异常!ClassCastException! 5 3.存在条件:继承关系,方法需要重写,父类引用指向子类对象!Father f1 = new Son(); 6 无法重写: 7 1.static 阅读全文

posted @ 2023-07-25 20:30 hhmzd233 阅读(8) 评论(0) 推荐(0) 编辑

2023.7.24 周一:重写
摘要:1 /* 2 重写: 3 1.方法名必须相同 4 2.参数列表必须相同 5 3.修饰符:范围可以扩大但不能缩小 public>protected>default>private 6 4.抛出的异常:范围,可以被缩小,但不能被扩大:classNotFoundException 7 */ 8 //重写: 阅读全文

posted @ 2023-07-24 20:00 hhmzd233 阅读(3) 评论(0) 推荐(0) 编辑

《大道至简》读后感
摘要:《大道至简》读后感 《大道至简》是一本经典的软件工程读物,作者通过深入浅出的方式传达了简洁的编程原则和设计哲学。读完这本书,我深刻地意识到简洁和清晰的代码对于软件开发的重要性,以及简单之美在软件工程中的力量。 首先,作者强调了简洁代码的重要性。在软件开发过程中,我们经常面对复杂的需求和繁琐的代码逻辑 阅读全文

posted @ 2023-07-23 18:53 hhmzd233 阅读(27) 评论(0) 推荐(0) 编辑

2023.7.23 周日:继承
摘要:1 //例:public class Students extends Person{} 2 //关键字extends 3 //在Java中所有的类都会直接或者间接继承object类 4 //在Java中只有单继承没有多继承 5 /////////////////////super 6 //main 阅读全文

posted @ 2023-07-23 18:49 hhmzd233 阅读(7) 评论(0) 推荐(0) 编辑

2023.7.22 周六:封装
摘要:1 //类 2 public class Student { 3 private String name; 4 private int age; 5 public void setName(String name) 6 { 7 this.name = name; 8 } 9 public Strin 阅读全文

posted @ 2023-07-22 20:27 hhmzd233 阅读(7) 评论(0) 推荐(0) 编辑

2023.7.21 周五:面向对象
摘要:1 //类 2 public class Student { 3 String name; 4 int age; 5 //使用new关键字,必然会调用构造器 6 public Student(){}//默认构造 7 //有参构造 8 public Student(String name) 9 { 1 阅读全文

posted @ 2023-07-21 18:49 hhmzd233 阅读(6) 评论(0) 推荐(0) 编辑

2023.7.20 周四:稀疏数组
摘要:1 import java.sql.SQLOutput; 2 import java.util.Arrays; 3 import java.util.Scanner; 4 //稀疏数组 5 public class test { 6 public static void main(String[] 阅读全文

posted @ 2023-07-20 20:45 hhmzd233 阅读(2) 评论(0) 推荐(0) 编辑

2023.7.19 周三:冒泡排序
摘要:1 import java.sql.SQLOutput; 2 import java.util.Arrays; 3 import java.util.Scanner; 4 //冒泡排序 5 public class test { 6 public static void main(String[] 阅读全文

posted @ 2023-07-19 20:03 hhmzd233 阅读(5) 评论(0) 推荐(0) 编辑

2023.7.18 周二:Arrays类
摘要:1 import java.sql.SQLOutput; 2 import java.util.Arrays; 3 import java.util.Scanner; 4 //Arrays类 5 public class test { 6 public static void main(String 阅读全文

posted @ 2023-07-18 21:27 hhmzd233 阅读(2) 评论(0) 推荐(0) 编辑

2023.7.17 周一:多维数组
摘要:1 import java.sql.SQLOutput; 2 import java.util.Scanner; 3 //多维数组 4 public class test { 5 public static void main(String[] args) { 6 Scanner sc = new 阅读全文

posted @ 2023-07-17 11:29 hhmzd233 阅读(2) 评论(0) 推荐(0) 编辑

2023.7.16
摘要:1 import java.sql.SQLOutput; 2 import java.util.Scanner; 3 //数组的使用 4 public class test { 5 public static void main(String[] args) 6 { 7 int[] arrays = 阅读全文

posted @ 2023-07-16 18:10 hhmzd233 阅读(4) 评论(0) 推荐(0) 编辑

2023.7.15
摘要:1 //2023.7.15 周六 2 //数组 3 public class test { 4 public static void main(String[] args) 5 { 6 int[] array = new int[10];//数组的定义 7 //数组不赋值,默认值为0 8 int a 阅读全文

posted @ 2023-07-15 08:00 hhmzd233 阅读(28) 评论(0) 推荐(0) 编辑

2023.7.14
摘要:1 2023.7.14 周五 2 //递归:适用于基数bi'ji 3 public class test 4 { 5 public static void main(String[] args) 6 { 7 8 System.out.println(f(5)); 9 } 10 public stat 阅读全文

posted @ 2023-07-14 20:18 hhmzd233 阅读(55) 评论(0) 推荐(0) 编辑

2023.7.13
摘要:1 //2023.7.13 周四 2 //可变参数 3 //参数类型 ... 参数名 4 //!!!!一个方法中最多可以指定一个可变参数,且只能作为最后一个参数,例:public static void test(int x,double...c) 5 public class test 6 { 7 阅读全文

posted @ 2023-07-13 20:49 hhmzd233 阅读(26) 评论(0) 推荐(0) 编辑

2023.7.12
摘要:1 //2023.7.12 周三 2 //方法声明和调用 3 public class test 4 { 5 public static void main(String[] args) 6 { 7 int sum = add(1,2); 8 System.out.println(sum); 9 } 阅读全文

posted @ 2023-07-12 19:41 hhmzd233 阅读(33) 评论(0) 推荐(0) 编辑

2023.7.11
摘要:1 //2023.7.11 周二 2 //for循环 3 public class test 4 { 5 public static void main(String[] args) 6 { 7 //打印九九乘法表 8 for(int i = 1;i<=9;i++) 9 { 10 for(int j 阅读全文

posted @ 2023-07-11 20:34 hhmzd233 阅读(18) 评论(0) 推荐(0) 编辑

2023.7.10
摘要:1 import java.util.Scanner; 2 3 public class test 4 { 5 public static void main(String[] args) 6 { 7 int i = 0; 8 int sum = 0; 9 10 while(i<100) 11 { 阅读全文

posted @ 2023-07-10 11:59 hhmzd233 阅读(8) 评论(0) 推荐(0) 编辑

2023.7.9
摘要:1 //选择结构 2 public class Main 3 { 4 public static void main(String[] args) 5 { 6 Scanner scanner = new Scanner(System.in); 7 System.out.println("请输入内容: 阅读全文

posted @ 2023-07-09 14:38 hhmzd233 阅读(10) 评论(0) 推荐(0) 编辑

2023.7.8
摘要:1 import java.util.Scanner; 2 3 public class test 4 { 5 public static void main(String[] args) 6 { 7 int i = 0; 8 float f = 0.0f; 9 10 Scanner scanner 阅读全文

posted @ 2023-07-08 13:31 hhmzd233 阅读(7) 评论(0) 推荐(0) 编辑

2023.7.7
摘要:1 //2023.7.7 2 //PTA 3 #include<iostream> 4 #include <iomanip> 5 #include<cstdio> 6 #include<cmath> 7 #include<cstring> 8 using namespace std; 9 void 阅读全文

posted @ 2023-07-07 20:01 hhmzd233 阅读(19) 评论(0) 推荐(0) 编辑

2023.7.6
摘要:1 //2023.7.6 周四 2 //java流程控制 3 //scanner 4 5 public static void main(String[] args) 6 { 7 //next方式 不能读取有空格的字符串 8 9 //创建一个扫描对象用于接收键盘数据 10 Scanner scann 阅读全文

posted @ 2023-07-06 14:39 hhmzd233 阅读(19) 评论(0) 推荐(0) 编辑

2023.7.5
摘要:1 //2023.7.5 周三 2 public static void main(String[] args) 3 { 4 //字符串连接符 + 5 int a = 10; 6 int b = 20; 7 System.out.println(""+a+b);//输出:1020 8 System. 阅读全文

posted @ 2023-07-05 21:06 hhmzd233 阅读(8) 评论(0) 推荐(0) 编辑

2023.7.4
摘要:2023.7.4 周二 1 Public class test 2 { 3 //运算符 4 Public static void main(String[] args) 5 { 6 int a = 1; 7 a++;//后置++ 8 ++a;//前置++ 9 //还有一些运算需要用到工具类 10 d 阅读全文

posted @ 2023-07-04 16:16 hhmzd233 阅读(9) 评论(0) 推荐(0) 编辑

2023.7.3
摘要:## 输入带空格的字符串 ~~~ c++ 1. #include <string.h> string s; getline(cin,s); 2. #include <cstring> #include <stdio.h> char a[1024]; gets(a); int len = strlen 阅读全文

posted @ 2023-07-03 17:45 hhmzd233 阅读(6) 评论(0) 推荐(0) 编辑

2023.7.2
摘要://2023.7.2 public class test { //类属性:可以理解为变量 /*{ 类变量:static int a = 0; 常量用 final修饰 例:static final int a = 3.14; 实例变量:string s = "不良帅"; }*/ string name 阅读全文

posted @ 2023-07-02 14:08 hhmzd233 阅读(32) 评论(0) 推荐(0) 编辑

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