JAVA第三次作业
2016-03-28 18:55
453 查看
package javazuoye; import java.util.Scanner; //import org.omg.Messaging.SyncScopeHelper; public class lianjia { public static void main(String[] args) { // TODO Auto-generated method stub text ae = new text(); ae.method(); } } class text{ public void text(){ } int sum = 0; void method(){ Scanner kbInput = new Scanner(System.in); kbInput.useDelimiter("\\s"); while(kbInput.hasNextInt()){ int nextValue = kbInput.nextInt(); sum += nextValue; } kbInput.close(); System.out.printf("sum:%d",sum); } }
相关文章推荐
- 解决java compiler level does not match the version of the installed java project facet
- java 你好!我的java学习之路 day1
- Java第三次作业
- java 使用freemarker 生成word模板
- Spring MVC DispatcherServlet contextConfigLocation设置
- Java学习:动态代理
- java PreparedStatement需要关闭,不然会内存溢出
- Spring事务的隔离级别
- Java中的static关键字解析
- 选择排序
- 40个Java多线程问题总结
- java学习笔记(三)
- Java文件上传的两种方式
- Java课程“新”得(三)
- java多线程——监视锁(monitor)
- Number Triangle
- java中的容器collection及其常用的子接口
- 浅析Java中CountDownLatch用法
- 快速修改eclipse的背景色
- javac的用法