摘要: The ArrayList class is a resizable array, which can be found in the java.util package. The difference between a built-in array and an ArrayList in Jav 阅读全文
posted @ 2022-11-27 07:25 小白冲冲 阅读(15) 评论(0) 推荐(0) 编辑
摘要: Java does not have a built-in Date class, but we can import the java.time package to work with the date and time API. ClassDescription LocalDate Repre 阅读全文
posted @ 2022-11-27 07:19 小白冲冲 阅读(27) 评论(0) 推荐(0) 编辑
摘要: The Scanner class is used to get user input, and it is found in the java.util package. To use the Scanner class, create an object of the class and use 阅读全文
posted @ 2022-11-27 07:06 小白冲冲 阅读(41) 评论(0) 推荐(0) 编辑
摘要: An enum is a special "class" that represents a group of constants (unchangeable variables, like final variables). enum Level { LOW, MEDIUM, HIGH } You 阅读全文
posted @ 2022-11-27 07:00 小白冲冲 阅读(25) 评论(0) 推荐(0) 编辑
摘要: Another way to achieve abstraction in Java, is with interfaces. An interface is a completely "abstract class" that is used to group related methods wi 阅读全文
posted @ 2022-11-27 06:47 小白冲冲 阅读(22) 评论(0) 推荐(0) 编辑
摘要: Abstraction can be achieved with either abstract classes or interfaces. The abstract keyword is a non-access modifier, used for classes and methods: A 阅读全文
posted @ 2022-11-27 06:40 小白冲冲 阅读(19) 评论(0) 推荐(0) 编辑
摘要: In Java, it is also possible to nest classes (a class within a class). The purpose of nested classes is to group classes that belong together, which m 阅读全文
posted @ 2022-11-27 06:32 小白冲冲 阅读(16) 评论(0) 推荐(0) 编辑
摘要: What are Classes and Objects? A class is a template for objects, and an object is an instance of a class. Static vs. Public we created a static method 阅读全文
posted @ 2022-11-27 06:17 小白冲冲 阅读(51) 评论(0) 推荐(0) 编辑
摘要: public class Main { static void myMethod() { System.out.println("I just got executed!"); } public static void main(String[] args) { myMethod(); } } // 阅读全文
posted @ 2022-11-25 02:58 小白冲冲 阅读(20) 评论(0) 推荐(0) 编辑
摘要: An array of strings String[] cars = {"Volvo", "BMW", "Ford", "Mazda"}; An array of integers int[] myNum = {10, 20, 30, 40}; Change an Array Element St 阅读全文
posted @ 2022-11-25 02:39 小白冲冲 阅读(24) 评论(0) 推荐(0) 编辑