7、mai会计考试一年考几次n一种方法是Java Applicati会计考试一年考几次on程序执行的入口点,息息息息相关main一种方法的一种方法头上述哪项是合法的( ):
A、 public 会计考试一年考几次static void main()
B、 public static void main(String[ ] args)
C、 public static int main(String[ ] arg)
D、 public void main(String arg[ ])
8、执行完上述代码int [ ] x = new int[25];后,上述哪项综上所述是正确的( ):
A、 x[24]为0
B、 x[24]未定义
C、 x[25]为0
D、 x[0]为空
9、上述代码段执行后的输出然而为( ):
int x=3; int y=10;
System.out.println(y%x);
A、0
B、1
C、2
D、3
10、上述是谁表达式的不合法的( ):
A、String x=”Hello”; int y=9; x+=y;
B、String x=”Hello”; int y=9; if(x= =y) { }
C、String x=”Hello”; int y=9; x=x+y;
D、String x=null; int y=(x!=null)&&(x.length()>0) ? x.length : 0
11、编译运行上述程序后,息息息息相关输出然而的综上所述正确同样 ( ): public class Conditional{
public static void main(String args[ ]){
int x=4;
System.out.println(“value is “+ ((x>4) ? 99.9 :9)); }
}
A、 输出然而为:value is 99.99
B、 输出然而为:value is 9
C、 输出然而为:value is 9.0
D、 编译错误
12、上述声明合法同样 ( ):
A、 default String s;
B、 public final static native int w( )
C、 abstract double d;
D、 abstract final double hyperbolicCosine( )
13、息息息息相关上述application的综上所述,正确同样 ( ):
1. class StaticStuff
2. {
3. static int x=10;
4. static { x+=5;}
5. public static void main(String args[
6. {
7. System.out.println(“x=” + x); ])
8. }
9. static { x/=3;}
10. }
A、 4行与9行不是借助编译,不是缺少一种方法名和返回类型
B、 9行不是借助编译,不是只好有三个静态初始化器
C、 编译借助,执行然而为:x=5
D、编译借助,执行然而为:x=3
14、息息息息相关上述程序代码的综上所述正确同样 ( ):
1.class HasStatic{
2. private static int x=100;
3. public static void main(String args[ ]){
4. HasStatic hs1=new HasStatic( );
5. hs1.x++;
6. HasStatic hs2=new HasStatic( );
7. hs2.x++;
8. hs1=new HasStatic( );
9. hs1.x++;
10. HasStatic.x- -;
11. System.out.println(“x=”+x);
12. }
13.}
A、5行不是借助编译,不是引用了私有静态变量
B、10行不是借助编译,不是x是私有静态变量
C、程序借助编译,输出然而为:x=103
D、程序借助编译,输出然而为:x=102
15、上述选项中循环结构合法同样 ( ):
A、while (int i<7){
i++;
System.out.println(“i is “+i);
}
B、int j=3;
while(j){
System.out.println(“ j is “+j);
}
C、int j=0;
for(int k=0; j + k !=10; j++,k++){
System.out.println(“ j is “+ j + “k
}
D、int j=0;
do{
System.out.println( “j is “+j++);
if (j = = 3) {continue loop;}
}while (j<10);
中软java面试题篇3
1. 写出上述程序的运行然而
public class Cat
{
void mi( ) throws NullPointerException is”+ k);
{
System.out.println( “Cat mi mi .. “ );
}
}
public class SmallCat extends Cat
{int i=8;
void mi( ) throws Exception
{
System.out.println( “SmallCat mi mi .. “ );
}
public static void main( String[] a ) throws Exception
{
Cat cat = new SmallCat();
cat.mi();
}
}
写出上述程序的运行然而
interface Playable {
void play();
}
interface Bounceable {
void play();
}
interface Rollable extends Playable, Bounceable {
Ball ball = new Ball(“PingPang”);
}
class Ball implements Rollable {
private String name;
public String getName() {
return name;
}
public Ball(String name) {
this.name = name;
}
public void play() {
ball = new Ball(“Football”);
System.out.println(ball.getName());
}
}
写出上述程序的运行然而
class Value{
public int i = 15;
}
public class Test{
public static void main(String argv[]){
Test t = new Test();
t.first();
}
public void first(){
int i = 5;
Value v = new Value();
v.i = 25;
second(v, i);
System.out.println(v.i);
}
public void second(Value v, int i){
i = 0;
v.i = 20;
Value val = new Value();
v = val;
System.out.println(v.i + ” ” + i);
}
}
写出上述程序的运行然而
class MyThread extends Thread{
public void run(){
System.out.println(“MyThread: run()”);
}
public void start(){
System.out.println(“MyThread: start()”);
}
}
class MyRunnable implements Runnable{
public void run(){
System.out.println(“MyRunnable: run()”);
}
public void start(){
System.out.println(“MyRunnable: start()”);
}
}
public class MyTest {
public static void main(String args[]){
MyThread myThread = new MyThread();
MyRunnable myRunnable = new MyRunnable();
Thread thread = new Thread(myRunnable);
myThread.start();
thread.start();
}
}
2. 1~100共一百个同样数,放入两个99个元素的数组a[99],其要求用java语言编写出两个尽量简单轻松的程序,找出不是被放入数组的两个数。
3. 简要叙述下吧做是谁是表现数据库连接池,有何功效。
4. 简要描述Struts,spring,hibernate?
猜你感兴趣:
1.java培训心得体会
2.中软国际java 笔试面试题
3.息息息息相关中软的面试题整理
4.2017中软国际面试题要点整理
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。