JAVA编程题
1.现在输入n个数字,以逗号,分开;然后可选择升或者降序排序;按提交键就在另一页面显示按什么排序,结果为,提供reset
import java.util.*;
public class bycomma{
public static String[] splitStringByComma(String source){
if(source==null||source.trim().equals(""))
return null;
StringTokenizer commaToker = new StringTokenizer(source,",");
String[] result = new String[commaToker.countTokens()];
int i=0;
while(commaToker.hasMoreTokens()){
result[i] = commaToker.nextToken();
i++;
}
return result;
}
public static void main(String args[]){
String[] s = splitStringByComma("5,8,7,4,3,9,1");
int[] ii = new int[s.length];
for(int i = 0;i<s.length;i++){
ii[i] =Integer.parseInt(s[i]);
}
Arrays.sort(ii);
//asc
for(int i=0;i<s.length;i++){
System.out.println(ii[i]);
}
//desc
for(int i=(s.length-1);i>=0;i--){
System.out.println(ii[i]);
}
}
}
2.金额转换,阿拉伯数字的金额转换成中国传统的形式如:(¥1011)->(一千零一拾一元整)输出。
package test.format;
import java.text.NumberFormat;
import java.util.HashMap;
public class SimpleMoneyFormat {
public static final String EMPTY = "";
public static final String ZERO = "零";
public static final String ONE = "壹";
public static final String TWO = "贰";
public static final String THREE = "叁";
public static final String FOUR = "肆";
public static final String FIVE = "伍";
public static final String SIX = "陆";
public static final String SEVEN = "柒";
public static final String EIGHT = "捌";
public static final String NINE = "玖";
public st
相关文档:
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--每页显示记录条数
@currentpage int output,--第几页
@orderid nvarchar(50),--主键排序
@sort int,--排序方式,1表示升序,0表示降序排列
......
2009-08-18 15:49
////设置居中(注意,要在设置窗体大小下面设置该句)
this.setLocationRelativeTo(null);
********************
String[] kecheng = {"Java","英语","数学"};
JComboBox jComboBox3 = new JComboBox(kecheng);
JComboBox jComboBox2 = new JComboBox();
******* ......
本案例是使用SQLSERVER2005作为数据源,使用TOMCAT6.0
第一步,把以下代码拷贝到tomcat的安装目录conf文件夹context.xml文件下。
数据库连接请修改
<Resource name="jdbc/demo"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.microsoft.sqlserver.j ......
1.J2EE是什么?
2.介绍JAVA中的Collection FrameWork(包括如何写自己的数据结构)?
如COLLECTION中遗留类(HASHTABLE、VECTOR)和现有类的区别?(同步)
3.Java中异常处理机制,事件机制?
4.EJB与JAVA BEAN的区别?
EJB与JAVA BEAN是SUN的不同组件 ......