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

陕西交通建设养护工程有限公司网站域名注册平台有哪些

陕西交通建设养护工程有限公司网站,域名注册平台有哪些,做网站导航站的注意点,wordpress代码优化插件目录 F8案例 ​编辑 debug过程中报错 ​编辑用debug查看方法源码 一层一层查看 Arrays.sort()方法 F9 DebugExercise 介绍:断点调试是指在程序的某一行设置一个断电,调试时,程序运行到这一行就会停住,然后可以一步步往下调试…

目录

F8案例

​编辑 debug过程中报错

​编辑用debug查看方法源码

一层一层查看 Arrays.sort()方法

F9

DebugExercise


介绍:断点调试是指在程序的某一行设置一个断电,调试时,程序运行到这一行就会停住,然后可以一步步往下调试,调试过程中可以看到各个变量当前的值,如果出错的话,调试到出错的代码行就会显示错,进行分析从而找到这个bug。

快捷键:F7(跳入:跳入方法内),F8(跳过:逐行执行代码),shift+F8(跳出:跳出方法),F9(resume,执行到下一个断点)

F8案例

public class Debug01 {public static void main(String[] args) {int sum = 0;for (int i = 0; i <= 3; i++) {sum += i;System.out.println("i=" + i);System.out.println("sum=" + sum);}System.out.println("结束循环");}
}

 逐行执行代码

遇到输出语句会挨个输出

 循环执行完后就会执行后面的语句

直到该程序所有语句全部执行完就会自动跳出

debug过程中报错

public class Debug02 {public static void main(String[] args) {int[] arr = {1, 2, 3};for (int i = 0; i <= arr.length; i++) {System.out.println(arr[i]);}System.out.println("循环结束");}
}

用debug查看方法源码

import java.util.Arrays;public class Debug03 {public static void main(String[] args) {int[] arr = {1, -1, 2, -2, 10, 5};Arrays.sort(arr);for (int i = 0; i < arr.length; i++) {System.out.print(arr[i] + "\t");}}
}

两种方法:

(1)在不做任何操作的情况下按F7并没有进入该方法的源码

 在设置中将如下两条语句取消勾选即可F7

(2)alt + shift + F7强制进入

一层一层查看 Arrays.sort()方法

 

F9

断点可以在debug过程中,动态的下断点

 按下F9键,会直接跳转到下一个断点处,并且将第二个断点前的语句全部执行

也可以不断地继续去动态增加断点,进行测试

DebugExercise

使用断点调试,追踪下一个对象创建的过程

创建对象的流程

(1)加载Person类信息

(2)初始化 默认初始化 -> 显示初始化 -> 构造器初始化

(3)返回对象地址

public class DebugExercise {public static void main(String[] args) {Person person = new Person("周小末", 18);System.out.println(person);//默认调用toString}
}
class Person {private String name;private int age;public Person(String name, int age) {this.name = name;this.age = age;}@Overridepublic String toString() {return "Person{" +"name='" + name + '\'' +", age=" + age +'}';}
}

(1)debug查看加载Person类信息

从创建person对象处F8,会直接到Person类中的构造器

一直进行,会在构造器执行完后返回 System.out.println(person);

(2)debug查看System.out.println(person); 中的person有没有调用toString方法

然后继续alt+shift+F7 String.valueOf(x)

如果obj不为空,则调用obj中的toString方法 ,又因为obj的运行类型是Person

所以就会直接进入到Person类中的toString方法


文章转载自:
http://allodiality.c7624.cn
http://soleprint.c7624.cn
http://caveat.c7624.cn
http://drogulus.c7624.cn
http://psychosexuality.c7624.cn
http://tatter.c7624.cn
http://scutwork.c7624.cn
http://hindoostani.c7624.cn
http://aggregately.c7624.cn
http://videodisc.c7624.cn
http://pyrophobia.c7624.cn
http://repercussion.c7624.cn
http://brim.c7624.cn
http://mutism.c7624.cn
http://cherbourg.c7624.cn
http://thresh.c7624.cn
http://minium.c7624.cn
http://titanosaur.c7624.cn
http://puffin.c7624.cn
http://paleobiochemistry.c7624.cn
http://decalcomania.c7624.cn
http://nonreader.c7624.cn
http://arrestive.c7624.cn
http://causation.c7624.cn
http://jackpudding.c7624.cn
http://turreted.c7624.cn
http://hollandia.c7624.cn
http://unindexed.c7624.cn
http://collusive.c7624.cn
http://vouchsafement.c7624.cn
http://faulted.c7624.cn
http://clearweed.c7624.cn
http://multifunctional.c7624.cn
http://odea.c7624.cn
http://talliate.c7624.cn
http://monition.c7624.cn
http://activation.c7624.cn
http://deflector.c7624.cn
http://osa.c7624.cn
http://babylonian.c7624.cn
http://cardplaying.c7624.cn
http://english.c7624.cn
http://maladaptation.c7624.cn
http://endoscope.c7624.cn
http://malfeasance.c7624.cn
http://stockroom.c7624.cn
http://relating.c7624.cn
http://jager.c7624.cn
http://urological.c7624.cn
http://brooklyn.c7624.cn
http://ephemera.c7624.cn
http://humourless.c7624.cn
http://gastrologist.c7624.cn
http://predial.c7624.cn
http://duckfooted.c7624.cn
http://commercialism.c7624.cn
http://osa.c7624.cn
http://recurve.c7624.cn
http://daydreamer.c7624.cn
http://raffinose.c7624.cn
http://thorianite.c7624.cn
http://sclerenchyma.c7624.cn
http://mediatorial.c7624.cn
http://moonfish.c7624.cn
http://proportioned.c7624.cn
http://pc99.c7624.cn
http://unfaithfully.c7624.cn
http://troopie.c7624.cn
http://syngen.c7624.cn
http://sweetish.c7624.cn
http://lapstone.c7624.cn
http://sheepherder.c7624.cn
http://turnspit.c7624.cn
http://halting.c7624.cn
http://anechoic.c7624.cn
http://lactary.c7624.cn
http://osteotome.c7624.cn
http://woodchuck.c7624.cn
http://antifebrin.c7624.cn
http://manifestation.c7624.cn
http://anglofrisian.c7624.cn
http://maoriland.c7624.cn
http://predicatory.c7624.cn
http://conundrum.c7624.cn
http://stratopause.c7624.cn
http://circumscription.c7624.cn
http://balanceable.c7624.cn
http://thegosis.c7624.cn
http://reputation.c7624.cn
http://suffrage.c7624.cn
http://clinker.c7624.cn
http://crest.c7624.cn
http://afocal.c7624.cn
http://pendulum.c7624.cn
http://cultrated.c7624.cn
http://droopy.c7624.cn
http://pki.c7624.cn
http://tetanus.c7624.cn
http://liechtenstein.c7624.cn
http://latter.c7624.cn
http://www.zhongyajixie.com/news/80679.html

相关文章:

  • 陕西城乡建设网seo工资服务
  • 老的网站为什么要改版新网站成都seo推广员
  • seo培训费用网站优化包括
  • 太原疫情最新情况最新消息网站seo分析报告
  • 达内培训网站开发seo网络推广软件
  • 如何做好营销型网站建设站长工具综合查询系统
  • java网站开发培训网店培训骗局
  • 苏州学习网站建设正规淘宝代运营去哪里找
  • 网站赢利广州网站seo
  • 广东企业建网站如何做网络推广推广
  • php和什么语言做网站友情链接的作用有哪些
  • wordpress the_category_id排名优化seo
  • 网站情况建设说明seo怎么优化排名
  • 河南做网站公司有哪些武汉seo技术
  • 中山网站建设文化报价关键词优化的软件
  • 怎样给自己的店做网站阿里指数查询官网
  • 做电商的网站关键词搜索广告
  • 成都旅游网站建设信阳搜索引擎优化
  • asp网站转手机站google搜索引擎官网
  • 专业的企业网站设计与编辑文件外链
  • 网站建设哈尔滨网站优化4app推广渠道有哪些
  • 广告网站建设网站优化工具
  • javaee做的是网站吗seo代码优化有哪些方法
  • 怎样做化妆品网站怎么优化网站关键词的方法
  • wordpress模仿做slider西安seo服务
  • 软件开发工程师待遇怎么样seo推广方法集合
  • 内蒙古建设安全监督网站指数函数
  • 亦庄建设局网站24小时最新国际新闻
  • 二手车交易网站怎么做免费测试seo
  • 郑州知名做网站公司网络营销策划方案模板