第二章基本数据类型和基本操作要点.ppt

  1. 1、本文档共84页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
第二章基本数据类型和基本操作要点

* Class 名: ComputeArea. 常量: PI and MAX_VALUE * 适当的缩进和空白 缩进风格 每个内层的组件或语句应该比外层缩进两格. 空行 使用空行把代码分段,以使程序更容易阅读. * 块的对齐方式 次行风格和尾行风格 ? * 编程错误 语法错误 编译过程中出现的错误 运行错误 引起程序非正常中断的错误(错误的输入类型,0做除数等) 逻辑错误 没有按照期望的要求执行 * 语法错误 public class ShowSyntaxErrors { public static void main(String[] args) { i = 30; System.out.println(i + 4); } } * 运行时错误 public class ShowRuntimeErrors { public static void main(String[] args) { int i = 1 / 0; } } * 逻辑错误 public ShowLogicError() { public static void main(String[] args) { int number1=2; int number2=3; number2+=number1+number2; System.out.println(number2=+number2); } } * Debugging Logic errors are called bugs. The process of finding and correcting errors is called debugging. A common approach to debugging is to use a combination of methods to narrow down to the part of the program where the bug is located. You can hand-trace the program (i.e., catch errors by reading the program), or you can insert print statements in order to show the values of the variables or the execution flow of the program. This approach might work for a short, simple program. But for a large, complex program, the most effective approach for debugging is to use a debugger utility. * Debugger Debugger is a program that facilitates debugging. You can use a debugger to Execute a single statement at a time. Trace into or stepping over a method. Set breakpoints. Display variables. Display call stack. Modify variables. * Debugging in JBuilder The debugger utility is integrated in JBuilder. You can pinpoint bugs in your program with the help of the JBuilder debugger without leaving the IDE. The JBuilder debugger enables you to set breakpoints and execute programs line by line. As your program executes, you can watch the values stored in variables, observe which methods are being called, and know what events have occurred in the program. JBuilder Optional * Setting Breakpoints A breakpoint is a stop sign placed on

文档评论(0)

ee88870 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档