import java.util.Locale;
/*
* 这是用来简化System.out.print的辅助类
*/
public class Print {
public void print(boolean b){
System.out.print(b);
}
public void print(char c){
System.out.print(c);
}
public void print(char []s){
System.out.print(s);
}
public void print(double d){
System.out.print(d);
}
public void print(float f){
System.out.print(f);
}
public void print(int i){
System.out.print(i);
}
public void print(long l){
System.out.print(l);
}
public void print(Object obj){
System.out.print(obj);
}
public void print(String s){
System.out.print(s);
}
public void printf(String format,Object args){
System.out.printf(format, args);
}
public void printf(Locale l,String format,Object args){
System.out.printf(l, format, args);
}
public void println(){
System.out.println();
}
public void println(boolean b){
System.out.println(b);
}
public void println(char c){
System.out.println(c);
}
public void println(char []s){
System.out.println(s);
}
public void println(double d){
System.out.println(d);
}
public void println(float f){
System.out.println(f);
}
public void println(int i){
System.out.println(i);
}
public void println(long l){
System.out.println(l);
}
public void println(Object obj){
System.out.println(obj);
}
public void println(String s){
System.out.println(s);
}
}
这是我自己编的辅助类
用的时候
Print p=new Print();
String str="sss";
boolean b=true;
char c='1';
char[] s=new char[]{'a','a'};
double d=10.2;
float f=1.1;
……
然后
p.print(str);
p.println(str);
……
就可以了,而且不影响system.out.println()的使用,想用system.out.println()的时候还可以用
我把自己的辅助类都共享出来了,大家多点点”对我有帮助“吧~谢谢了
温馨提示:答案为网友推荐,仅供参考