JAVA程序员面试题
1、数据库
表a和表b具有完全相同的结构,主键为indexid。写出一个sql语句把表b中不存在而表a中存在的数据插入到表b中。
2、javascript部分
页面中有一个名称都为unitprice的type=text对象。要求输入的数据不能为空,写一个函数实现该功能,如果为空时给出提示。
3、JSP部分
①session中存储一个String变量,变量名称为studentname,写出在jsp中如何得到这个session变量的值的语句。
②在jsp中引用使用来引用javabean.
Ⅰscope的值有哪些,这些值的区别是什么?
Ⅱ不同的jsp页面中引用javabean时,id能否相同,如果能相同,对scope的值有什么要求?
4、JAVA部分
①输入一个维数,输出以下形式的矩阵和数列,以维数n=4为例:
0000
0111
0122
0123
②写出下面这段程序的运行结果
int a=2,b=3,c=1
a+=–b+c;
c-=b+a++;
System.out.println(“a=”+a+”,b=”+b+”,c=”+c);
5、有一个Vector对象,其中每一个元素都是一个String对象,请用for循环或while循环输出Vector中的元素,要求格式为:”第i个元素为:aaa”
6、有一个HashMap其中key为String对象,value为Integer对象,写一个方法打印出此Map中的所有键值 对形如 key–value
7、有一个String str=”001,A001;002,A002;003,A003″的串,写一个方法,把此串存入列 一个HashMap或Hashtable中,说明:如001为key,A001则为value。
8、面向对象概念:
①面向对象基本特征
②什么叫多态和重载,它们有什么区别?
③用你自己的话描述你理解的j2ee的本质特征是什么?
第一题: 写一个方法,实现删除链表中某个节点的操作(其他条件自己假设,补充)
public void delete()
{
if(front>=rear)
{
s[front] =0;
front–;
System.out.println(“ delete successful”);
}
else
{
System.out.println(“the link is empty ,can’t delete”);
}
}
第二题:写一个方法,实现堆栈的入栈操作 (其他条件自己假设,补充)
public class stack{
private int[] s;
int top,bottom;
public stack(int size){
s = new int[size];
top = size-1;
bottom = size-1;
System.out.println(“Size of the stack is:”+size);
}
public boolean isEmpty()
{
if(top==s.length-1)
return true;
else
return false;
}
public void push(int n)
{
if(top=s.length-1)
{
System.out.println(“The stack is empty,Can’t pop now!”);
return;
}
else
{
top++;
}
}
public void print()
{
System.out.println(“State of the stack:”);
for(int i=s.length-1;i>top;i–)
{
System.out.print(s[i]+” ”);
}
}
public static void main(String[] a)
{
stack st = new stack(5);
System.out.println(“List of the action to the stack:”);
System.out.println(“push(3):”);
st.push(3);
st.print();
System.out.println(” ”);
System.out.println(“push(6)”);
st.push(6);
st.print();
System.out.println(” ”);
System.out.println(“push(10)”);
st.push(10);
st.print();
System.out.println(” ”);
System.out.println(“pop()”);
st.pop();
st.print();
System.out.println(” ”);
}
}
第三题: 使用任意排序算法,写一个排序示例程序
import java.io.*;
class SelectionSort{
public static void main(String[] args){
int[] a={4,54,8,7,6,98,42,};
sort(a);
for(int i=0;i
System.out.print(a[i]+” “);
}
System.out.println(“”);
}
static void sort(int[] data){
int next, indexOfNext=0,n;
for (next=0;next
表a和表b具有完全相同的结构,主键为indexid。写出一个sql语句把表b中不存在而表a中存在的数据插入到表b中。
2、javascript部分
页面中有一个名称都为unitprice的type=text对象。要求输入的数据不能为空,写一个函数实现该功能,如果为空时给出提示。
3、JSP部分
①session中存储一个String变量,变量名称为studentname,写出在jsp中如何得到这个session变量的值的语句。
②在jsp中引用使用来引用javabean.
Ⅰscope的值有哪些,这些值的区别是什么?
Ⅱ不同的jsp页面中引用javabean时,id能否相同,如果能相同,对scope的值有什么要求?
4、JAVA部分
①输入一个维数,输出以下形式的矩阵和数列,以维数n=4为例:
0000
0111
0122
0123
②写出下面这段程序的运行结果
int a=2,b=3,c=1
a+=–b+c;
c-=b+a++;
System.out.println(“a=”+a+”,b=”+b+”,c=”+c);
5、有一个Vector对象,其中每一个元素都是一个String对象,请用for循环或while循环输出Vector中的元素,要求格式为:”第i个元素为:aaa”
6、有一个HashMap其中key为String对象,value为Integer对象,写一个方法打印出此Map中的所有键值 对形如 key–value
7、有一个String str=”001,A001;002,A002;003,A003″的串,写一个方法,把此串存入列 一个HashMap或Hashtable中,说明:如001为key,A001则为value。
8、面向对象概念:
①面向对象基本特征
②什么叫多态和重载,它们有什么区别?
③用你自己的话描述你理解的j2ee的本质特征是什么?
第一题: 写一个方法,实现删除链表中某个节点的操作(其他条件自己假设,补充)
public void delete()
{
if(front>=rear)
{
s[front] =0;
front–;
System.out.println(“ delete successful”);
}
else
{
System.out.println(“the link is empty ,can’t delete”);
}
}
第二题:写一个方法,实现堆栈的入栈操作 (其他条件自己假设,补充)
public class stack{
private int[] s;
int top,bottom;
public stack(int size){
s = new int[size];
top = size-1;
bottom = size-1;
System.out.println(“Size of the stack is:”+size);
}
public boolean isEmpty()
{
if(top==s.length-1)
return true;
else
return false;
}
public void push(int n)
{
if(top=s.length-1)
{
System.out.println(“The stack is empty,Can’t pop now!”);
return;
}
else
{
top++;
}
}
public void print()
{
System.out.println(“State of the stack:”);
for(int i=s.length-1;i>top;i–)
{
System.out.print(s[i]+” ”);
}
}
public static void main(String[] a)
{
stack st = new stack(5);
System.out.println(“List of the action to the stack:”);
System.out.println(“push(3):”);
st.push(3);
st.print();
System.out.println(” ”);
System.out.println(“push(6)”);
st.push(6);
st.print();
System.out.println(” ”);
System.out.println(“push(10)”);
st.push(10);
st.print();
System.out.println(” ”);
System.out.println(“pop()”);
st.pop();
st.print();
System.out.println(” ”);
}
}
第三题: 使用任意排序算法,写一个排序示例程序
import java.io.*;
class SelectionSort{
public static void main(String[] args){
int[] a={4,54,8,7,6,98,42,};
sort(a);
for(int i=0;i
System.out.print(a[i]+” “);
}
System.out.println(“”);
}
static void sort(int[] data){
int next, indexOfNext=0,n;
for (next=0;next
【JAVA程序员面试题】相关文章
3. Java程序员面试题
4. 初级Java程序员面试题
5. 高级Java程序员面试题
6. JAVA程序员面试题
7. Java程序员面试题
8. JAVA高级程序员面试题
本文来源:https://www.mianshiwenti.com/a12451.html
进入下载页面
上一篇:内部类的定义、种类以及优点
下一篇:代码中finally中的代码会不会执行
﹝JAVA程序员面试题﹞相关内容
- 一套ASP程序员面试题
- "火柴棍式"程序员面试题
- 程序员面试犹如“面试官 + 求职者 = 猫 + 老鼠 ?”
- 程序员面试什么最重要?
- JAVA程序员面试经验
- PHP程序员面试自我介绍
- 程序员面试自我介绍
- 高级Java程序员面试要点
- java程序员面试交流
- 掌上明珠Java程序员面试总结