摘要: public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("请输入手机号码:"); String s=input.nextLine();//获取输入的一行字符串 阅读全文
posted @ 2022-10-23 17:01 需求解决器 阅读(301) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("请输入一个正整数:"); int num=input.nextInt(); int c=getNum( 阅读全文
posted @ 2022-10-23 17:00 需求解决器 阅读(382) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { Scanner input=new Scanner(System.in); int[] a=new int[10];//定义一个数组 //给数组的10个元素赋值 for (int i = 0; i < a.length 阅读全文
posted @ 2022-10-23 16:59 需求解决器 阅读(877) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { for (int i = 1; i <= 7; i++) { for (int j = 7; j >= 2 * i - 1; j--) { System.out.print("*"); } System.out.pri 阅读全文
posted @ 2022-10-23 16:57 需求解决器 阅读(142) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { Scanner input =new Scanner(System.in); System.out.println("请输入一个三位的正整数:"); int num=input.nextInt(); boolean i 阅读全文
posted @ 2022-10-23 16:50 需求解决器 阅读(652) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { for (int i = 1; i <=9; i++) { for (int j = 1; j <=i; j++) { System.out.print(j+"*"+i+"="+j*i+"\t"); } System. 阅读全文
posted @ 2022-10-23 16:48 需求解决器 阅读(151) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { Scanner input =new Scanner(System.in); //输入年份 System.out.println("请输入年份:"); int year=input.nextInt(); //输入月份 阅读全文
posted @ 2022-10-23 16:39 需求解决器 阅读(1072) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("请输入放假月份"); int month1=input.nextInt(); System.out.p 阅读全文
posted @ 2022-10-23 16:35 需求解决器 阅读(45) 评论(0) 推荐(0)
摘要: Public 是一个访问权限(访问修饰符)公共 static 修饰的成员称为类成员或者静态成员 void 当方法定义时用void修饰时,表示没有返回值 String 类来创建和操作字符串 阅读全文
posted @ 2022-05-13 21:00 需求解决器 阅读(114) 评论(0) 推荐(0)
摘要: Global variables(全局变量) 是指可以全局访问的变量, Java不支持全局变量,原因如下: 全局变量破坏了引用的透明性。 全局变量制造了命名空间冲突。 可以使用properties类将想要全局有效的变量值写在properties文件中,那么在何处用时都从此properties文件中读 阅读全文
posted @ 2022-05-13 20:59 需求解决器 阅读(382) 评论(0) 推荐(0)