随笔分类 -  Java

上一页 1 2 3 下一页
数组的声明和创建
摘要:1 package array; 2 3 public class ArrayDemo01 { 4 //变量的类型 变量的名字 = 变量的值 5 //数组类型 6 public static void main(String[] args) { 7 int[] nums;//1.声明一个数组 8 n 阅读全文
posted @ 2022-07-23 09:00 一枚努力学习的小白 阅读(38) 评论(0) 推荐(0) 编辑
命令行传递参数
摘要:1 package method; 2 3 public class Demo03 { 4 public static void main(String[] args) { 5 //args.length数组长度 6 for (int i = 0; i < args.length; i++) { 7 阅读全文
posted @ 2022-07-23 08:59 一枚努力学习的小白 阅读(18) 评论(0) 推荐(0) 编辑
可变参数
摘要:1 package method; 2 3 public class Demo04 { 4 public static void main(String[] args) { 5 Demo04 demo04 = new Demo04(); 6 demo04.test(1,2,3,4,5,6,7); 7 阅读全文
posted @ 2022-07-23 08:59 一枚努力学习的小白 阅读(16) 评论(0) 推荐(0) 编辑
什么是方法?
摘要:1 package method; 2 3 public class Demo01 { 4 //main方法 5 public static void main(String[] args) { 6 int sum = add(1,2); 7 System.out.println(sum); 8 t 阅读全文
posted @ 2022-07-23 08:58 一枚努力学习的小白 阅读(25) 评论(0) 推荐(0) 编辑
方法的定义和调用
摘要:1 package method; 2 3 public class Demo02 { 4 public static void main(String[] args) { 5 int max = max(20, 10); 6 System.out.println(max); 7 } 8 //比大小 阅读全文
posted @ 2022-07-23 08:58 一枚努力学习的小白 阅读(20) 评论(0) 推荐(0) 编辑
方法的重载
摘要:1 package method; 2 3 public class Demo02 { 4 public static void main(String[] args) { 5 double max = max(20, 10); 6 System.out.println(max); 7 } 8 // 阅读全文
posted @ 2022-07-23 08:58 一枚努力学习的小白 阅读(20) 评论(0) 推荐(0) 编辑
打印三角形及Debug
摘要:流程控制练习: 1 package struct; 2 3 public class TestDemo { 4 public static void main(String[] args) { 5 //打印三角形 5行 6 for (int i = 0; i <= 5 ; i++) { 7 for 阅读全文
posted @ 2022-07-21 16:32 一枚努力学习的小白 阅读(11) 评论(0) 推荐(1) 编辑
break、continue、goto
摘要:1 package struct; 2 3 public class BreakDemo { 4 public static void main(String[] args) { 5 int i = 0 ; 6 while(i<100){ 7 i++; 8 System.out.println(i) 阅读全文
posted @ 2022-07-21 16:29 一枚努力学习的小白 阅读(17) 评论(0) 推荐(1) 编辑
增强for循环
摘要:1 package struct; 2 3 public class ForDemo05 { 4 public static void main(String[] args) { 5 int[] numbers = {10,20,30,40,50};//定义一个数组 6 for (int i = 0 阅读全文
posted @ 2022-07-21 16:27 一枚努力学习的小白 阅读(15) 评论(0) 推荐(0) 编辑
打印九九乘法表
摘要:① 1 package struct; 2 3 public class ForDemo04 { 4 public static void main(String[] args) { 5 /* 6 1 * 1 = 1 7 1 * 2 = 2 2 * 2 = 4 8 1 * 3 = 3 2 * 3 = 阅读全文
posted @ 2022-07-21 16:26 一枚努力学习的小白 阅读(59) 评论(0) 推荐(1) 编辑
For循环详解
摘要:1 package struct; 2 3 public class ForDemo01 { 4 public static void main(String[] args) { 5 int a = 1;//初始化条件 6 while(a<=100){//条件判断 7 System.out.prin 阅读全文
posted @ 2022-07-21 16:25 一枚努力学习的小白 阅读(324) 评论(0) 推荐(1) 编辑
DoWhile循环
摘要:1 package struct; 2 3 public class DoWhileDemo01 { 4 public static void main(String[] args) { 5 int i = 0; 6 int sum = 0; 7 do { 8 sum = sum + i; 9 i+ 阅读全文
posted @ 2022-07-21 16:24 一枚努力学习的小白 阅读(24) 评论(0) 推荐(1) 编辑
While循环详解
摘要:1 package struct; 2 3 public class WhileDemo01 { 4 public static void main(String[] args) { 5 int i = 0; 6 while(i<100){ 7 i++; 8 System.out.println(i 阅读全文
posted @ 2022-07-21 16:23 一枚努力学习的小白 阅读(54) 评论(0) 推荐(1) 编辑
switch选择结构
摘要:1 package struct; 2 3 public class SwitchDemo01 { 4 public static void main(String[] args) { 5 //case穿透 6 char grade = 'C'; 7 8 switch(grade){ 9 case 阅读全文
posted @ 2022-07-18 17:04 一枚努力学习的小白 阅读(17) 评论(0) 推荐(1) 编辑
if选择结构
摘要:1 package struct; 2 3 import java.util.Scanner; 4 5 public class IfDemo01 { 6 public static void main(String[] args) { 7 Scanner scanner = new Scanner 阅读全文
posted @ 2022-07-18 17:03 一枚努力学习的小白 阅读(17) 评论(0) 推荐(1) 编辑
顺序结构
摘要:1 package struct; 2 3 public class ShunXuDemo { 4 public static void main(String[] args) { 5 System.out.println("hello1"); 6 System.out.println("hello 阅读全文
posted @ 2022-07-18 17:02 一枚努力学习的小白 阅读(22) 评论(0) 推荐(1) 编辑
Scanner进阶使用
摘要:1 package Scanner; 2 3 import java.util.Scanner; 4 5 public class Demo02 { 6 public static void main(String[] args) { 7 //从键盘接收数据 8 Scanner scanner = 阅读全文
posted @ 2022-07-18 15:53 一枚努力学习的小白 阅读(21) 评论(0) 推荐(1) 编辑
用户交互Scanner
摘要:1 package Scanner; 2 3 import java.util.Scanner; 4 5 public class Demo01 { 6 public static void main(String[] args) { 7 //创建一个扫描器对象,用于接收键盘数据 8 Scanner 阅读全文
posted @ 2022-07-18 15:51 一枚努力学习的小白 阅读(17) 评论(0) 推荐(1) 编辑
JavaDoc生成文件
摘要:package Base; /** * @author yangyue * @version 1.0 * @since 1.8 */ public class Doc { String name; /** * * @param name * @return * @throws Exception * 阅读全文
posted @ 2022-07-01 08:36 一枚努力学习的小白 阅读(41) 评论(0) 推荐(1) 编辑
包机制
摘要:package Operator; import java.util.Date; //导入这个包下所有的类! import Operator.*; public class Demo01 { public static void main(String[] args) { //二元运算符 //ctr 阅读全文
posted @ 2022-07-01 08:12 一枚努力学习的小白 阅读(15) 评论(0) 推荐(1) 编辑

上一页 1 2 3 下一页