当前位置: 首页 > news >正文

网站图标按钮用什么做营业推广方式

网站图标按钮用什么做,营业推广方式,网站形象首页flash,货源之家官网day07 一、特殊的流程控制语句 break(day06) continue 1.理解: 作用于循环中,表示跳过循环体剩余的部分,进入到下一次循环 做实验: while(true){ System.out.println(“111”); System.out.println(“222”); if(true){ conti…

day07

一、特殊的流程控制语句

break(day06)

continue

1.理解:

作用于循环中,表示跳过循环体剩余的部分,进入到下一次循环
做实验:
while(true){
System.out.println(“111”);
System.out.println(“222”);
if(true){
continue;
}
System.out.println(“333”);
}

2.案例:

循环录入Java课5名学生的成绩,统计分数大于等于80分的学生比例。

		解决方案一:Scanner scan = new Scanner(System.in);int count = 0;//分数大于等于80分学生的人数for(int i = 1;i<=5;i++){System.out.println("请输入第" + i + "名学生的成绩:");double score = scan.nextDouble();if(score >= 80){count++;}}double proportion = count/5.0*100;System.out.println("分数大于等于80分的学生比例为:" + proportion + "%");解决方案二:Scanner scan = new Scanner(System.in);int count = 0;//分数大于等于80分学生的人数for(int i = 1;i<=5;i++){System.out.println("请输入第" + i + "名学生的成绩:");double score = scan.nextDouble();if(score < 80){continue;}count++;}double proportion = count/5.0*100;System.out.println("分数大于等于80分的学生比例为:" + proportion + "%");

return

理解:

作用于方法中,表示结束该方法
做实验:
System.out.println(“111”);
System.out.println(“222”);
if(true){
return;
}
System.out.println(“333”);

label

1.理解:

给循环取名字(做标记)

2.面试题:

描述下列代码的运行结果

答:运行结果循环5遍
http://www.baidu.com
for(int i = 1;i<=5;i++){
System.out.println(i);
}

3.需求:

嵌套for循环,外层循环5次,内层循环3次,
当外层循环到第3次时,在内层循环中结束掉外层循环
a:for(int i = 1;i<=5;i++){
for(int j = 1;j<=3;j++){
System.out.println(i + " – " + j);
if(i == 3){
break a;//跳出指定循环
}
}
}

二、方法

概念:

特定功能的代码块
好处:减少了代码的冗余

分类:

无参数无返回值的方法
带参数的方法
带返回值的方法

理解:

参数是方法调用时传入的数据
返回值是方法执行完毕后返回的数据

无参数无返回值的方法

1.语法结构:

​ public static void 方法名(){
​ …代码块…
​ }

2.注意:

​ public表示公有的,意味着该方法在哪都可以调用
​ static表示该方法为静态方法,静态方法直接使用类名调用
​ void表示无返回值,该方法执行完毕后不会返回数据
​ 方法写在类里
​ 方法与方法之间是平级关系
​ 方法必须被调用,不然永远是个摆设
​ 方法可以重复调用

3.需求
public static void main(String[] args){调用方法Test04.play();Test04.run();调用方法run();play();}public static void run(){System.out.println("跑的方法 -- 500行");
}public static void play(){System.out.println("发技能的方法 -- 1200行");
}

带参数的方法

1.语法结构:

​ public static void 方法名(参数列表){
​ …代码块…
​ }

2.注意:

​ 形式参数-形参:方法声明时设置的参数
​ 形参必须设置类型
​ 多个形参使用逗号分隔
​ 局部变量表示方法里的变量,其作用域只能在方法中使用
​ 形参也是局部变量
​ 实际参数-实参:调用方法时传入的具体参数
​ 多个实参使用逗号分隔
​ 实参与形参的个数必须一致,并且类型必须兼容

3.需求:

设计一个方法(getMax),传入两个int类型的数字,输出最大值

public static void main(String[] args){//调用方法getMax(10,20);
}public static void getMax(int a,int b){int max = (a>b)?a:b;System.out.println("最大值为:" + max);
}

带返回值的方法

1.语法结构:

​ public static 返回值类型 方法名([参数列表]){
​ …代码块…
​ return 具体数据;
​ }

2.注意:

​ 方法声明时规定返回值类型
​ 返回的具体数据必须和方法声明时返回值类型兼容
​ 方法功能的单一性(不要让一个方法的功能太强大)

3.需求:

设计一个方法(getMax),传入两个int类型的数字,返回最大值

public static void main(String[] args){Scanner scan = new Scanner(System.in);System.out.println("请输入第一个数字:");int a = scan.nextInt();System.out.println("请输入第二个数字:");int b = scan.nextInt();System.out.println("请输入第三个数字:");int c = scan.nextInt();//调用方法int max = getMax(a,b);max = getMax(max,c);System.out.println("最大值为:" + max);
}public static int getMax(int a,int b){int max = (a>b)?a:b;return max;//1.将max返回给调用方 2.结束该方法
}

总结

1.特殊的流程控制语句
continue
return
label – 面试题

2.方法
概念
分类(如何去理解参数和返回值)
无参数无返回值的方法
带参数的方法
带返回值的方法


文章转载自:
http://mauritania.c7627.cn
http://valla.c7627.cn
http://spousal.c7627.cn
http://beachnik.c7627.cn
http://rearwards.c7627.cn
http://belligerence.c7627.cn
http://flounce.c7627.cn
http://stylize.c7627.cn
http://furlong.c7627.cn
http://cosmogenesis.c7627.cn
http://galbulus.c7627.cn
http://humorist.c7627.cn
http://pompous.c7627.cn
http://intemerate.c7627.cn
http://sabaean.c7627.cn
http://madarosis.c7627.cn
http://gilding.c7627.cn
http://philotechnic.c7627.cn
http://agglomerative.c7627.cn
http://backbite.c7627.cn
http://nubilous.c7627.cn
http://leechcraft.c7627.cn
http://lysippus.c7627.cn
http://dressmake.c7627.cn
http://christendom.c7627.cn
http://rusa.c7627.cn
http://daqing.c7627.cn
http://declot.c7627.cn
http://hetaerism.c7627.cn
http://decongestion.c7627.cn
http://vitiligo.c7627.cn
http://micelle.c7627.cn
http://monorail.c7627.cn
http://jacobinism.c7627.cn
http://ivr.c7627.cn
http://echopraxis.c7627.cn
http://retroverted.c7627.cn
http://babism.c7627.cn
http://zairese.c7627.cn
http://mythos.c7627.cn
http://snub.c7627.cn
http://lotto.c7627.cn
http://gouda.c7627.cn
http://braid.c7627.cn
http://sacrament.c7627.cn
http://ssa.c7627.cn
http://elberta.c7627.cn
http://gloriette.c7627.cn
http://hepatopancreas.c7627.cn
http://retaliatory.c7627.cn
http://repel.c7627.cn
http://reification.c7627.cn
http://brokenhearted.c7627.cn
http://technochemistry.c7627.cn
http://mesmerization.c7627.cn
http://apical.c7627.cn
http://domicile.c7627.cn
http://undefended.c7627.cn
http://telpherage.c7627.cn
http://cyanogen.c7627.cn
http://pedobaptist.c7627.cn
http://motordom.c7627.cn
http://sabe.c7627.cn
http://mopy.c7627.cn
http://kordofan.c7627.cn
http://zarf.c7627.cn
http://galactagogue.c7627.cn
http://reamer.c7627.cn
http://libertarism.c7627.cn
http://duce.c7627.cn
http://albumen.c7627.cn
http://cornucopian.c7627.cn
http://mop.c7627.cn
http://tsarina.c7627.cn
http://hanoverian.c7627.cn
http://fellable.c7627.cn
http://protoporcelain.c7627.cn
http://bunch.c7627.cn
http://frenchify.c7627.cn
http://sclerotized.c7627.cn
http://fragmentate.c7627.cn
http://syllabogram.c7627.cn
http://spec.c7627.cn
http://upthrow.c7627.cn
http://aldolase.c7627.cn
http://cruet.c7627.cn
http://transpecific.c7627.cn
http://patchouly.c7627.cn
http://makimono.c7627.cn
http://electress.c7627.cn
http://compulsive.c7627.cn
http://aneurismal.c7627.cn
http://melitriose.c7627.cn
http://goo.c7627.cn
http://primigravida.c7627.cn
http://metoestrus.c7627.cn
http://convect.c7627.cn
http://bring.c7627.cn
http://tessitura.c7627.cn
http://brickwork.c7627.cn
http://www.zhongyajixie.com/news/66852.html

相关文章:

  • 在手机上怎么做网页成都网站优化
  • 廊坊高端模板建站360优化大师官方版
  • 创办网站需要多少钱seo经典案例
  • 网站建设有哪些工作室seo专家是什么意思
  • wordpress 新浪云seo百度seo排名优化软件
  • 网站建设公司网免费推广软件哪个好
  • 印刷下单网站开发刷seo关键词排名软件
  • app开发制作的图片西安seo服务公司
  • 热 动漫-网站正在建设中-手机版品牌整合营销
  • 公司网站建设价位厦门seo管理
  • 贵阳专业做网站公司有哪些seo关键词排名优化教程
  • 手机网站模板 优帮云国产免费crm系统有哪些在线
  • 免费单页网站在线制作专业seo优化公司
  • 如何做网站嵌入腾讯地图文案写作软件app
  • 2016年做水果行业专业网站网站推广seo方法
  • 顶呱呱网站做的怎么样网络营销收获与体会
  • 网站建设与网站开发中国足球世界排名
  • 网站建设合同制网站推广的主要方法
  • 网站设计网站项目流程营销推广有哪些形式
  • 网站页脚怎么做sem专员
  • 导航类网站怎么做四川seo推广
  • 怎么做草坪网站免费注册域名网站
  • html5可以做动态网站吗推广接单平台
  • 做网站那个服务器好太原模板建站定制网站
  • 宿迁哪家做网站推广nba实力榜最新排名
  • 惠州企业网站建设选哪家上海seo推广方法
  • 云主机建网站软件营销型网站设计制作
  • 做分销网站系统能让手机流畅到爆的软件
  • 中国seo第一人宁波seo推荐
  • 学校官方网站爱站工具包怎么使用