站长www.software8.co

热转印www.heatpress123.net

JAVA--实现类似C#输入功能的Console类

[java] view plaincopy /* (程序头部注释开始) * 程序的版权和版本声明部分 * Copyright (c) 2011, 烟台大学计算机学院学生 * All rights reserved. * 文件名称:实现类似C#输入功能的Console类 * 作 者: 雷恒鑫 * 完成日期: 2012 年 09 月 20 日 * 版 本 号: V1.0 * 对任务及求解方法的描述部分 * 输入描述: * 问题描述: * 程序输出: * 程序头部的注释结束 */ import java.util.Scanner; public class Console { public static String readLine(){ Scanner sc=new Scanner(System.in); return sc.next(); } public static char readLine_char(){ Scanner sc=new Scanner(System.in); String str=sc.next(); return str.charAt(0); } public static int readInt(){ Scanner sc=new Scanner(System.in); String str=sc.next(); return Integer.parseInt(str); } public static double readDouble(){ Scanner sc=new Scanner(System.in); String str=sc.next(); return Double.parseDouble(str); } }

posted on 2012-09-23 16:56 文哥哥 阅读(185) 评论(0)  编辑  收藏

<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

导航

统计

常用链接

留言簿

随笔档案

文章档案

友情链接

最新随笔

搜索

最新评论

阅读排行榜

评论排行榜