import java.io.*;public class fo
{
public static void main(String [] args) throws Exception
{
byte x[] = new byte[20];
System.in.read(x);
//x[20] = new String[20];
for(int i=0;i<x.length;i++)
{
for(int j=0;j<x.length;j++)
{
x[20] = new String[20];
//if (x[i]!=null&&x[j]!=null)
//{
System.out.print(x[i]+x[j]);
//}
}
}
}
}
该怎么写?我写了好几种都是错的!请帮帮看下 先谢了
{
public static void main(String [] args) throws Exception
{
byte x[] = new byte[20];
System.in.read(x);
//x[20] = new String[20];
for(int i=0;i<x.length;i++)
{
for(int j=0;j<x.length;j++)
{
x[20] = new String[20];
//if (x[i]!=null&&x[j]!=null)
//{
System.out.print(x[i]+x[j]);
//}
}
}
}
}
该怎么写?我写了好几种都是错的!请帮帮看下 先谢了
解决方案 »
- Socket建立连接后~
- 编码问题
- 初次使用IntelliJ IDEA碰到的一个的问题,请列位大虾不吝赐教,感谢感谢!
- 大四毕业设计求教
- 新手看书没看懂,请各位大哥帮解释一下,好么?
- 如果TreeSet中存储的是整形的对象1,10,80,35,41,100......那么怎么指定它里面的元素按从小到大的顺序排列?排序后怎样将这个TreeSet中的元
- 急!!我用installanywhere怎么也放不到开始菜单里面去!!!!!!
- java+corba+applet
- 在线等:关于多线程下键盘事件的监听
- 介个咋弄,我好像自己不行~
- 求 一个文件中的字符串在另一个文件中共出现了多少次
- 很简单的字符串替换问题
或者你要用某种编码的话 new String(x,"GBK");
试试这样:
——————————————————————
package com.chao.test;import java.io.*;public class Fo {
public static void main(String[] args) throws IOException {
BufferedReader buf;
String str;
buf = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Please input a string:");
str = buf.readLine(); //读取字符串,敲回车结束
System.out.println("The string You input is: " + str);
}
}——————————————————————不知是否对搂住有帮助。
语法错误. 应该是 x = new String[20];
前提是 String [] x;