摘要: 可变参数 public class Demo04 { public static void main(String[] args) { test(1,2,3,4,5,6); } //方法中包含可变参数 public static void test(int... i){ System.out.pri 阅读全文
posted @ 2023-02-06 12:56 佩德罗帕斯卡 阅读(19) 评论(0) 推荐(0)
摘要: 什么是方法 public class Demo02 { public static void main(String[] args) { int sum = add(20, 60);//调用方法 System.out.println(sum); } //新建个加法方法 public static i 阅读全文
posted @ 2023-02-06 12:55 佩德罗帕斯卡 阅读(14) 评论(0) 推荐(0)
摘要: public class D { public static void main(String[] args) { for (int i = 0; i < 100; i++) { System.out.println(i); } } } 练习1 ////////////////for方法 publi 阅读全文
posted @ 2023-02-05 21:17 佩德罗帕斯卡 阅读(26) 评论(0) 推荐(0)
摘要: while循环 public class Demo05 { public static void main(String[] args) { int sum=0; int T=0; while(T<=100){ sum=sum+T; T++; } System.out.println(sum); } 阅读全文
posted @ 2023-02-05 21:15 佩德罗帕斯卡 阅读(17) 评论(0) 推荐(0)
摘要: package com.wang.struct; public class Demo04 { public static void main(String[] args) { char grade='D'; switch(grade){ case 'A': System.out.println("优 阅读全文
posted @ 2023-02-05 14:47 佩德罗帕斯卡 阅读(14) 评论(0) 推荐(0)
摘要: if单选择结构 package com.wang.struct; import java.util.Scanner; public class Demo01 { public static void main(String[] args) { Scanner scanner = new Scanne 阅读全文
posted @ 2023-02-05 14:45 佩德罗帕斯卡 阅读(43) 评论(0) 推荐(0)
摘要: package com.wang.scanner; import java.sql.SQLOutput; import java.util.Scanner; public class Demo03 { public static void main(String[] args) { Scanner 阅读全文
posted @ 2023-02-05 12:35 佩德罗帕斯卡 阅读(14) 评论(0) 推荐(0)
摘要: package com.wang.scanner; import java.util.Scanner; public class Demo01 { public static void main(String[] args) { //创建一个扫描器对象,用于接收键盘数据 Scanner scanne 阅读全文
posted @ 2023-02-05 12:35 佩德罗帕斯卡 阅读(18) 评论(0) 推荐(0)
摘要: -encoding UTF-8 -charset UTF-8 Idea方法生成 zh_CN -encoding UTF-8 -charset UTF-8 package com.wang.base; /** * @author wangpengfei * @version 1.0 * @since 阅读全文
posted @ 2023-02-05 12:34 佩德罗帕斯卡 阅读(13) 评论(0) 推荐(0)
摘要: ![](https://img2023.cnblogs.com/blog/3091163/202302/3091163-20230205123324998-961127645.png) 阅读全文
posted @ 2023-02-05 12:33 佩德罗帕斯卡 阅读(5) 评论(0) 推荐(0)