上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 133 下一页
摘要: * 数组是引用传递 ``` public class HelloWorld { public static void main(String[] args){ // 数组是引用数据类型;就一定会发生引用传递; int data [] = new int [] {10,20,30}; int temp 阅读全文
posted @ 2023-06-03 15:49 盘思动 阅读(14) 评论(0) 推荐(0)
摘要: ``` public class HelloWorld { public static void main(String[] args){ //int data [] = {1,2,3};// 静态初始化 - 简略格式 int data [] = new int [] {11,22,33};// 静 阅读全文
posted @ 2023-06-03 15:22 盘思动 阅读(13) 评论(0) 推荐(0)
摘要: ``` class Book {// 类的名称要以class开头,否则报错,并且提示不到这行代码!!! private int bid; private String title; private double price; private static int count = 0; public 阅读全文
posted @ 2023-06-02 23:26 盘思动 阅读(15) 评论(0) 推荐(0)
摘要: * 用static ,引入计数器案例 ``` class User { private String uid; private String password; private static int count = 0; public User(){ this("NOID","mldn"); } p 阅读全文
posted @ 2023-06-02 23:02 盘思动 阅读(20) 评论(0) 推荐(0)
摘要: 构造一个银行账户类,类的构成包括如下内容: 1.数据成员用户的账户名称,用户的账户余额(private数据类型) 2.方法包括开户(设置账户名称及余额),利用构造方法完成 3.查询余额 ``` class Account { private String name; private double b 阅读全文
posted @ 2023-06-02 22:47 盘思动 阅读(18) 评论(0) 推荐(0)
摘要: * 狗的一个类,包括 名字,颜色,年龄;典型的java类的一段代码 ``` class Dog { private String name; private String color; private int age; public Dog(){} public Dog(String name,St 阅读全文
posted @ 2023-06-02 22:37 盘思动 阅读(26) 评论(0) 推荐(0)
摘要: ``` class Employee { private long empno; private String ename; private double salary; private double rate; public Employee(){} public Employee(long em 阅读全文
posted @ 2023-06-02 22:18 盘思动 阅读(15) 评论(0) 推荐(0)
摘要: ``` class Address { private String country; private String province; private String city; private String street; private String zipcode; public Addres 阅读全文
posted @ 2023-06-02 22:03 盘思动 阅读(17) 评论(0) 推荐(0)
摘要: ### demo1 ``` class Person { public Person(){ System.out.println("[构造方法]Person 类构造方法执行"); } {// 构造块-会先于构造方法执行;并且每次实例化新对象的时候,都会调用构造块中的代码; System.out.pr 阅读全文
posted @ 2023-06-02 17:10 盘思动 阅读(16) 评论(0) 推荐(0)
摘要: ``` class Person { public Person(){ System.out.println("[构造方法]Person 类构造方法执行"); } {// 构造块会先于构造方法执行;并且每次实例化新对象的时候,都会调用构造块中的代码; System.out.println("[构造块 阅读全文
posted @ 2023-06-02 16:54 盘思动 阅读(17) 评论(0) 推荐(0)
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 133 下一页