摘要: 1.1 什么是变量 现在我们修改一下之前编写的Hello World程序,实现从键盘输入一个名字,如Mike,屏幕上就输出”Hello,Mike”。代码如下: 第4条语句是实例化一个Scanner对象,负责从键盘获取输入的数据1。程序的基本思路是把输入的姓名先存放在name中(第5条语句),然后再从 阅读全文
posted @ 2018-09-18 11:25 盆古 阅读(333) 评论(0) 推荐(0) 编辑
摘要: /****************************************************************************** * Compilation: javac Quadratic.java * Execution: java Quadatic b c * * Given b and c, solves for the roots... 阅读全文
posted @ 2018-09-18 10:40 盆古 阅读(250) 评论(0) 推荐(0) 编辑
摘要: /****************************************************************************** * Compilation: javac DoubleOps.java * Execution: java DoubleOps a b * * Illustrates the integer operations... 阅读全文
posted @ 2018-09-18 10:37 盆古 阅读(294) 评论(0) 推荐(0) 编辑
摘要: /****************************************************************************** * Compilation: javac Ruler.java * Execution: java Ruler * * Prints the relative lengths of the subdivision... 阅读全文
posted @ 2018-09-18 10:35 盆古 阅读(328) 评论(0) 推荐(0) 编辑