标签:images ges util asc common comm code ack turn
添加Scanner的输入
新建一个工具类
/**
*
*
*/
//package ******.tools.Scanner;
import java.util.Scanner;
public class MyScanner {
private static MyScanner myScanner;
private Scanner sc;
private MyScanner(){
sc = new Scanner(System.in);
}
public static MyScanner getInstance(){
if(null == myScanner)
myScanner = new MyScanner();
return myScanner;
}
public Scanner getSc() {
return sc;
}
}
其他类引用需要输入时,
import ************tools.MyScanner;
= MyScanner.getInstance().getSc().next****();
//代码框模板
<div class="cnblogs_code">
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a title="复制代码" onclick="copyCnblogsCode(this)" href="javascript:void(0);"><img src="//common.cnblogs.com/images/copycode.gif" alt="复制代码" /></a></span></div>
<pre>
</pre>
<div class="cnblogs_code_toolbar"><span class="cnblogs_code_copy"><a title="复制代码" onclick="copyCnblogsCode(this)" href="javascript:void(0);"><img src="//common.cnblogs.com/images/copycode.gif" alt="复制代码" /></a></span></div>
</div>
标签:images ges util asc common comm code ack turn
原文地址:http://www.cnblogs.com/k624030678/p/7112611.html