Java中用自己的包的小问题?? 不会吧!将你的包所在的文件夹路径添加到CLASSPATH中再编译试试!譬如:ConsoleReader包在d:\mypackage下,就将d:\mypackage添加到CLASSPATH中! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 包的使用代码package ConsoleReader;public class arrayConversiontemp{ private int[][] _data = null; public arrayConversiontemp(int[][] data) { this._data = data;//构造函数,传递数组 } public String getFormatStr() { if (_data==null||_data.length==0||this._data[0].length==0) { return null;//如果数组为空 } int rowCount= this._data.length;//获取行数 int colCount= this._data[0].length;//获取列数 //定义返回字符串 String output = "The Data of two dimensional array:\n"; for (int i=0;i<rowCount ;i++ ) { //输出原始二维数组 for (int j=0;j<colCount ;j++ ) { if ( j == 0 && i == 0 ) output += "┏"; if ( j == 0 && i == rowCount-1 ) output += "┗"; if ( j == 0 && i != 0 && i != rowCount-1) output += "┃"; //二维数组的输出 output += " "+_data[i][j]+" "; if ( j == colCount-1 && i != 0 && i != rowCount-1) output += "┃"; if ( j == colCount-1 && i == 0 ) output += "┓"; if ( j == colCount-1 && i == rowCount-1 ) output += "┛"; } output += "\n"; } return output;} /* public static void main(String[] args) { //预设 5 * 4 的矩阵数据 int[][] Data = { {9, 7, 6, 6}, {9, 7, 6, 6}, {3, 5, 3, 3}, {6, 6, 4, 7}, {7, 5, 1, 4}, {1, 2, 8, 0} }; arrayConversiontemp temp = new arrayConversiontemp(Data); System.out.println(temp.getFormatStr()); }*/} java界面问题+数据库问题 刚学线程,谁能帮我看下程序错哪里? 这样的问题你遇到过没有? 如何通过正则表达式将select t1.c1,t2.c2 from table1 t1 中select 与 from之间的字符串提取出来或换成其他字符串? 关于数据库操作的N层架构问题 请教关于BigInteger的问题 请教:怎样将数据库中的数据项和字段添加到文本文件的指定位置? response.sendRedirect()问题 关于jdbc查询问题,百思不得其解! 高分请教 JB 高手----程序不能脱离 JB 的环境运行 讨论:Java学习方向 很急!!!!!
{
private int[][] _data = null;
public arrayConversiontemp(int[][] data)
{
this._data = data;//构造函数,传递数组
} public String getFormatStr()
{ if (_data==null||_data.length==0||this._data[0].length==0)
{
return null;//如果数组为空
} int rowCount= this._data.length;//获取行数
int colCount= this._data[0].length;//获取列数
//定义返回字符串
String output = "The Data of two dimensional array:\n";
for (int i=0;i<rowCount ;i++ )
{ //输出原始二维数组
for (int j=0;j<colCount ;j++ )
{
if ( j == 0 && i == 0 )
output += "┏";
if ( j == 0 && i == rowCount-1 )
output += "┗";
if ( j == 0 && i != 0 && i != rowCount-1)
output += "┃";
//二维数组的输出
output += " "+_data[i][j]+" "; if ( j == colCount-1 && i != 0 && i != rowCount-1)
output += "┃";
if ( j == colCount-1 && i == 0 )
output += "┓";
if ( j == colCount-1 && i == rowCount-1 )
output += "┛";
}
output += "\n";
}
return output;
}
/*
public static void main(String[] args)
{
//预设 5 * 4 的矩阵数据
int[][] Data =
{ {9, 7, 6, 6},
{9, 7, 6, 6},
{3, 5, 3, 3},
{6, 6, 4, 7},
{7, 5, 1, 4},
{1, 2, 8, 0}
}; arrayConversiontemp temp = new arrayConversiontemp(Data);
System.out.println(temp.getFormatStr()); }
*/
}