摘要: 递归 递归头:什么时候不调用自身。如果没有头,将陷入死循环。 递归尾:什么时候需要调用自身方法 package com.method;​public class Domn06 { //阶乘 2! public static void main(String[] args) { System.out. 阅读全文
posted @ 2020-04-12 11:22 乖执事 阅读(831) 评论(2) 推荐(1)
摘要: 方法 修饰符 返回值类型 方法名(参数类型 参数名){ 。。。 方法体 。。。 return 返回值; } 形参 实参 package com.method;​public class Domn01 { //main 方法 public static void main(String[] args) 阅读全文
posted @ 2020-04-12 11:19 乖执事 阅读(154) 评论(0) 推荐(0)
摘要: break 直接终止循环 强制退出程序 package com.struct;//break 直接终止循环 强制退出程序public class BreakDomn { public static void main(String[] args) { int i=0; while (i<100){ 阅读全文
posted @ 2020-04-09 21:04 乖执事 阅读(474) 评论(0) 推荐(0)
摘要: 循环 while while是最基本的循环,它的结构为: while(布尔表达式){ //循环内容 }; package com.struct;​public class WhileDomn01 { public static void main(String[] args) {​ //输入1~10 阅读全文
posted @ 2020-04-09 20:08 乖执事 阅读(124) 评论(0) 推荐(0)
摘要: swith swith单运用 package com.struct;​public class SwitchDomn01 { public static void main(String[] args) { char grade = 'A'; //case穿透 //swith 匹配一个具体的值​ s 阅读全文
posted @ 2020-04-07 17:43 乖执事 阅读(457) 评论(0) 推荐(0)
摘要: if if单判断 package com.struct;​import java.util.Scanner;​public class ifDomn01 { public static void main(String[] args) { Scanner scanner= new Scanner(S 阅读全文
posted @ 2020-04-07 17:41 乖执事 阅读(178) 评论(0) 推荐(0)
摘要: Scanner 关于scanner的基础运用 scanner(System.in)(重点注意) scanner hasNext package com.scanner;​import java.util.Scanner;​public class Domn01 { public static voi 阅读全文
posted @ 2020-04-07 17:38 乖执事 阅读(204) 评论(0) 推荐(0)
摘要: 运算符 除法产生小数时要注意类型 package operator;​public class Domn01 { public static void main(String[] args) { int a=10; int b=20; int c=25; int d=25;​ System.out. 阅读全文
posted @ 2020-04-07 10:11 乖执事 阅读(91) 评论(0) 推荐(0)
摘要: 类型转换 java是强类型语言,所以有些运算需要用到类型转换 byte,short,char->int->long->float->double public class Domn04 { public static void main(String[] args) { int i=128; byt 阅读全文
posted @ 2020-04-06 08:44 乖执事 阅读(205) 评论(0) 推荐(0)
摘要: idea下载 操作缩写 psvm:public static void main Sout:Strtem.out.println(); 八大数据类型 import java.sql.SQLOutput;public class DOMN02 { public static void main(Str 阅读全文
posted @ 2020-04-05 08:39 乖执事 阅读(1041) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示