单项选择题
public class Test { public static void main(String [] args) { int x =5; boolean b1 = true; boolean b2 = false; if((x==4) && !b2) System.out.print(”l “); System.out.print(”2 “); if ((b2 = true) && b1) System.out.print(”3 “); } } What is the result?()
Which code, inserted at line 16, correctly retrieves a local instance of a Point object?()
1. public class ReturnIt { 2. return Type methodA(byte x, double y) { 3. return (short)x / y * 2; 4. } 5. } What is the narrowest valid returnType for methodA in line2?()
What is the result when the programmer attempts to compile the code and run it with the command java Converter 12?()
public class ArrayTest { public static void main (Stringargs) { float f1, f2; f1 = new float [10]; f2 = f1; System.out.printIn (“f2[0]=” + f2[0]); } } What is the result?()
多项选择题
Given the following code, which code fragments, when inserted at the indicated location, will succeed in making the program display a button spanning the whole window area?() import java.awt.*; public class Q1e65 { public static void main(String args[]) { Window win = new Frame(); Button but = new Button("button"); // insert code fragment here win.setSize(200, 200); win.setVisible(true); } }
Given: package com.sun.scjp; public class Geodetics { public static final double DIAMETER = 12756.32; //kilometers } Which two correctly access the DIAMETER member of the Geodetics class?()
int x = 1, y =6; while (y--) { x++; } System.out.println(“x =” + x + “y =” +y); What is the result?()
赞题库-搜题找答案
(已有500万+用户使用)
无需下载 立即使用
版权所有©考试资料网(ppkao.com)All Rights Reserved