中科软java面试题_面试题中科软
中科软java面试题由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“面试题中科软”。
中科软: 走去就是上机考试 接着是面试 上机题: 1: 写一个html文件,包括用户名,登陆密码.用户名是一个电子邮件,格式是里面必须含有@和.底下有一个登陆按钮,点击登陆按钮,用js代码判断,判断电子邮件格式是否符合,若符合就提示“登陆成功”,若不成功,则提示错误.2:有一个表,字段有保单号,保单金额 让你按保单号给保单金额汇总 select sno,sum(smoney)from 表名 group by sno having sum(smoney)>500000;3:给定一个字符串,求出该字符串里哪个字符出现的次数最多
4:给定一个字符串和一个预定的长度,把这个字符串按照这个长度分割成几部分,重新组合为一个字符串数组
5:读取一个文件,给定一个字符串,判断这个字符串在文件中出现的次数
6:随机产生10个数,并每个数给定一个序号,然后将这10个数按照从小到大的顺序输出来,并带上序号输出.面试题: 1.自我介绍
2.数据库中如何分页 3.说一下你的项目
4.数据库中有哪些连接,有什么区别(就是内连接,外连接等待...)5.说说struts 6.做一个项目,有哪些步骤? 需求分析,软件设计,写文档....(这个上网百度一下)7.statement和preparedstatement的区别? package test;public cla Count1 {
/**
* @paramargs
*/ staticintcountNum = 0;staticintcountLetter = 0;staticintcountOther = 0;public static void main(String[] args){
// TODO Auto-generated method stub
String str = “sdSAAaazzZ12...,”;
char[] c = str.toCharArray();
for(inti=0;i
if(c[i]>='a'&&c[i]='A'){
countLetter++;
}else if(c[i]>='0'&&c[i]
countNum++;
}else{
countOther++;
}
}
System.out.println(“字母:”+countLetter);
System.out.println(“数字:”+countNum);
System.out.println(“其他:”+countOther);
} } /^s*([A-Za-z0-9_-]+(.w+)*@([w-]+.)+w{2,3})s* $/ public static void main(String[] args){
test(“abbcccddddaa”);
}
public static void test(String str){ intmax_length = 0;String max_str = “”;while(str.length()> 0){ int length = str.length();String first = str.substring(0, 1);str = str.replaceAll(first, “”);if(max_length
importjava.io.FileInputStream;
importjava.io.FileNotFoundException;
importjava.io.IOException;
importjava.io.InputStreamReader;
importjava.util.Scanner;
邮箱表达式
public cla Main {
public static void main(String[] args)throws IOException {
Scanner input = new Scanner(System.in);
System.out.println(“请输入文件名:”);
String fileName = input.next();
BufferedReaderbr = new BufferedReader(new FileInputStream(fileName)));
System.out.println(“请输入要查找的字符串:”);
String find = input.next();
long count = 0;
String line = br.readLine();
while(null!= line){
count += count(line,find);
line = br.readLine();
}
System.out.println(“文件” + fileName + “中共有” + count +“个” + find);
br.close();
}
/**
* 在str中查找find,并返回找到的个数
* @paramstr从文件读入的一行
* @param find 要查找的字符串
* @return str中find的个数
*/
private static long count(String str,String find){
long count = 0;
intlen = find.length();
int index = 0;
for(inti=0;i
if((index = str.indexOf(find, i))>-1)
count ++;
else break;
}
return count;
}
}
InputStreamReader(new