Tìm kiếm:
TRANG NHÀ
Giới thiệu VNEDU.ORG
Điều khoản và bản quyền
Liên lạc VNEDU
TRẮC NGHIỆM TRỰC TUYẾN
---Công Cụ:---
Soạn Biểu thức
Bảng màu HTML
Ký hiệu đặc biệt 01
Ký hiệu đặc biệt 02
Ký hiệu đặc biệt 03
Ký hiệu đặc biệt 04
Ký hiệu đặc biệt 05
Ký hiệu đặc biệt 06
Ký hiệu đặc biệt 07
Ký hiệu đặc biệt [Toán]
55 bài trong 6 trang (10 bài/trang) và bạn đang ở trang 1.
Demo

You need to store elements in a collection that guarantees that no duplicates are stored. Which one of the following interfaces provide that capability? A. Java.util.Map B. Java.util.List C. Java.util.Collection D. None of the above...... Which collection class allows you to access its elements by associating a key with an element's value, and provides synchronization? A. java.util.SortedMap B. java.util.TreeMap C. java.util.TreeSet D. java.util.Hashtable.........

Demo

What will be the output of the program? public class Test { public int aMethod() { static int i = 0; i++; return i; } public static void main(String args[]) { Test test = new Test(); test.aMethod(); int j = test.aMethod(); System.out.println(j); } } A. 0 B. 1 C. 2 D. Compilation fails........ What will be the output of the program? class PassA { public static void main(String [] args) { PassA p = new PassA(); p.start(); } void start() .........

Demo

Which cannot directly cause a thread to stop executing? A. Calling the SetPriority() method on a Thread object. B. Calling the wait() method on an object. C. Calling notify() method on an object. D. Calling read() method on an InputStream object........ Which method registers a thread in a thread scheduler? A. run(); B. construct(); C. start(); D. register();.......

Demo

What will be the output of the program? class Super { public int i = 0; public Super(String text) /* Line 4 */ { i = 1; } } class Sub extends Super { public Sub(String text) { i = 2; } public static void main(String args[]) { Sub sub = new Sub("Hello"); System.out.println(sub.i); } } A. 0 B. 1 C. 2 D. Compilation fails........

Demo

What will be the output of the program? public abstract class AbstractTest { public int getNum() { return 45; } public abstract class Bar { public int getNum() { return 38; } } public static void main (String [] args) { AbstractTest t = new AbstractTest() { public int getNum() { return 22; } }; AbstractTest.Bar f = t.new Bar() { public int getNum() { return 57; } }; System.out.println(f.getNum() + " " + t.getNum()); } } A. 57 22 B. 45 38 C. 45 57 D. An exception occurs at runtime........

Demo

Which two of the following are legal declarations for nonnested classes and interfaces? final abstract class Test {} public static interface Test {} final public class Test {} protected abstract class Test {} protected interface Test {} abstract public class Test {} A. 1 and 4 B. 2 and 5 C. 3 and 6 D. 4 and 6........ public class While { public void loop() { int x= 0; while ( 1 ) /* Line 6 */ { System.out.print("x plus one is " + (x + 1)); /* Line 8 */ } } } Which statement is true? A. There is a syntax error on line 1........

Demo

Which of the following statements about the hashcode() method are incorrect? The value returned by hashcode() is used in some collection classes to help locate objects. The hashcode() method is required to return a positive int value. The hashcode() method in the String class is the one inherited from Object. Two new empty String objects will produce identical hashcodes. A. 1 and 2 B. 2 and 3 C. 3 and 4 D. 1 and 4.... What will be the output of the program? public class TestObj { public static void main (String [] args) { Object o = new Object() /* Line 5 */ { public boolean equals(Object obj) { return true; } } /* Line 11 */........

Demo

Which cause a compiler error? A. int[ ] scores = {3, 5, 7}; B. int [ ][ ] scores = {2,7,6}, {9,3,45}; C. String cats[ ] = {"Fluffy", "Spot", "Zeus"}; D. boolean results[ ] = new boolean [] {true, false, true}; E. Integer results[ ] = {new Integer(3), new Integer(5), new Integer(8)};...... Which three are valid method signatures in an interface? private int getArea(); public float getVol(float x); public void main(String [] args); public static void main(String [] args);......

Demo

What will be the output of the program? public class SyncTest { public static void main (String [] args) { Thread t = new Thread() { Foo f = new Foo(); public void run() { f.increase(20); } }; t.start(); } } class Foo { private int data = 23; public void increase(int amt) { int x = data; data = x + amt; } } and assuming that data must be protected from corruption, what—if anything—can you add to the preceding code to ensure the integrity of data? A. Synchronize the run method. B. Wrap a synchronize(this) around the call to f.increase(). C. The existing code will cause a runtime exception. D. Synchronize the increase() method.........

Demo

What is the most restrictive access modifier that will allow members of one class to have access to members of another class in the same package? A. public B. abstract C. protected D. synchronized E. default access....... You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective? A. public B. private C. protected D. default access........

    2    3    4    5    Right  
Thống kê:
Phát triển hệ thống: TRƯƠNG HỮU ĐỨC - Phiên bản 3.0 - © Copyright 2013 - 2024 - VNEDU.ORG

free counters