A-Java

Màu nền
Font chữ
Font size
Chiều cao dòng

Put your story text here...1. Which class is the superclass of all the input stream class

[A] InputStream

B. FileInputStream

C. Stream

D. Input

1. The____method returns the name of the thread

A. public final String receiveName()

B. public final String requestName()

C. public final String checkName()

D. public final String isName()

E. public final String returmName()

[F] public final String getName()

2. Filters operate on the buffer, which is located between the program and destination of the buffered stream

A. FALSE

[b] TRUE

3. ______can be used to write development tools likes debuggers, class browsers or GUI buiders

[A] API

B. Annotation

C. Regular expression

D. Reflection

4. ______is the ability of an object to data beyond the lifetime of the object

[A] Encapsulation

B. Inheritance

C. Polymorphism

D. Persistence

E. Construction

F. Destruction

5. Streams does not help in sharing of data over computer network

[A] FALSE

B. TRUE.

6. Thread priorities are numbers and from range from Thread.NORM_PRIORITY to Thread.MAX_ PRIORITY

[A] FALSE

B. TRUE

7. Which are invalid returm types of the annotation mathod? (choose four)

[A] Vector

[b] Array of valid types

[C] String

[D] enum

E. Class

8. LinkedHasSet maintains the sorting of the items added to the set

A. FALSE

[A] TRUE

9. ____class doesn't permit(cho phép) duplication(sao chép) of elements

A. Queue

B. Vector

C. Stack

[D] Set

11. The definition(định nghĩa) must be annotated(chú thích) with the annotion type to include it in the javadoc

A. @Retention

B. @Override

[C] @Documented

D. @SuppressWarnings

E. @Deprecated

12. java.lang package contrains the _________class from which you obtain input and output streams

A. Object

[b] System

C. Class

D. Runtime

13. The ______ method returns true if the thread is a user thread

A. verifyDaemon()

B. get Daemon()

C. set Daemon()

[D] isDaemon()

14. The_______method with the argument as true will convert the user thread to a daemon thread

A. convertToDaemon()

[b] setDaemon()

C. isDaemon()

D. SetDaemon()

15. _______denotes the set of all types or any in generrics

A. ? extends Type

B. super Type

[C] ?

16. A thread is in ______state when it is waiting for the lock of another object

A. terminated

B . waiting

[C] blocked

D. runnable

17. Multithreading helps_______(choose 2)

A. programs hava more fault tolerance capability

B. double speed of the systems

[C] increase performance of single-processor systems

[D] reduce the CPU idle time

18. Choose two INCORRECT statements about the java.lang package

[A] contains the class Class which is the root of the class hierarchy

B. is imported by default into all programs

C. has classes that contain complex scientific funtions

[D] contains classes pertaining to strings and string buffers

19. Which classes allows duplication of elements (choose 2)

[A] Vector

B. Set

[C] SortedSet

20. Your programming problem is to create a list of unique values of part ID numbers in a large collection of data representing orders. Furthermore, it would be nice if the list was in sorted order.

You have decided to use one of the collection classes in the java.util package to construct this list. Which of the following interfaces shuold the ideal class implement?

A. Set

B. Map

C. List

D. SortedMap

E. SortedSet

21. Which does this code means

Public static <T> void copy(List<? Super T>dest, List<? Extends T>source)

A. Two parameters must be derived from T

[b] Type of the dest parameter is super type of T, and type of the source parmeter is sub type of T

C. Two parameters must be super types of T

D. Type of the dest parameter is type of T, and type of the source parameter is super is type type of T

22. The @Override annotation indicates that annotated method is required to override a method in super class. If a method with this annotation does not override the method of super class, the compiler will generate an error

A.FALSE

[b] TRUE

23. Use reflection, arrays can be created at runtime

A. FALSE

[b] TRUE

24. The threads that run system code are____________

[A] daemon threads

B. single threads

C. user threads

D. system threads

25. A newly created thread inherits the prioty of its parent thread

A. FALSE

[b] TRUE

26. The ______condition describes a situation where two or more thread a blocked forever, waiting for each other

A. synchtonizaion

[b] race

C. deadlock

D. blocking

27. _______is a wrapper class for int data type

A. Double

B. Byte

[C] Integer

D. Long

28. In generics you cannot create genric constructor?

A. FALSE

[b] TRUE

29. Which statemenst are CONRRECT about generics (choose 2)

A. One of the advantages of using gernerics is early early error detection at runtime

B. Generics can be only apply for classes and methods

[C] A generic type has type paramenters

[D] Wildcards are divided into two types: bounded and unbounded

30. ___________API retrieves the object and its interface for examiantion

A. Annotation

B. Generics

[C] Reflection

D. Regular expresson

31. The below code can create a thread object and makes it runnable?

Class MyRunnable implements Runnable{

Public void run(){

....//Implementation

}

Public static void main(String args[]){

MyRunnable mrObj = new MyRunnable();

Thread thObj = new MyRunnable(thObj);

}

[A] FALSE

B. TRUE

32. Erasure removes all generic type information

A. FALSE

[b] TRUE

33. The thread comes out of the _________state when the start() method is invoked on it

[A] runnable

B. waiting

C. terminated

D. blocked

34. Which method of DataInput is used to read and return one byte

[A] readByte()

B. readInt()

C. readOneByte()

D. readBytes()

35. The ______method suspends a thread for a certain period of time

A. public static Boolean interrupted()

B. public void destroy()

C. public void interrupt()

D. public void start()

[E] public static void sleep(long millis) throws InterredException

36. __________allow access to elements based on their position, bus not allow to search a specific element

A. TreeSet

[b] Vector

C. HashSet

D. LinkedHashSet

37. Is this code snippet incorrect?

List<String> myIntList = new LinKedList<String>();

myIntList.add(0);

[A] FALSE

B.TRUE

38. Is this code snippet correct or incorrect?

Class MyGen<E>

{

E param;

MyGen(E e)

{

Param = e;

}

A. Cannot casting

B. Cannot find relevant constructor

C. Syntax error

[D] correct

39. How to assign field values using reflection

A. assign()

B. Set()

[C] SetField()

D. assignField()

40 . Which of the following statements are TRUE with reference to FileInputStream class? (Choose all answers)

A. It provides the method getFD() that is used to close the stream while being processed by the Java garbage collector.

[b] It provides the method getFD() that is used to obtain access to the FileDescriptor associated with the input stream.

[C] This class overrides methods of InputStream class.

[D] Objects of this class are created using a filename string or File or a FileDescriptor object as argument.

E. It provides method valid() that help to determine whether a file descriptor object is currently valid or not.

41. Which pattern implements subtraction expression

A. [0-9&&[345]]

B. [0-9&[345]]

[C]. [0-9&&[^345]]

D. [0-9&[^345]]

42. The @Deprecated annotation indicates that when a deprecated program element is used, the compiler should NOT give a warning

[A] FALSE

B. TRUE

43. ByteArrayInputStream class doesn't maintain any internal counter to keep track of the next byte to be read

[A] FALSE

B. TRUE

44. ObjectInput interface extends the DataInput interface but have methods that support object serialization

[A] FALSE

B. TRUE

45. The deadlock situation allows the normal execution of the program after few minutes

[A] FALSE

B. TRUE

46. Paramenters in annotation are declared as fields in a class

[A] FALSE

B. TRUE

47. A synchronized block is a ______or a______ qualified by synchronized keyword

A. Class

[b] block of code

C. function

[D] method

48. In which class are the following methods defined

- wait()

- notify()

- notifyAll()

A. Synchronize

[b] Object

C. Runnable

D. Thread

E. In which class depends on particular implementation of the Java Virtual Machine

49. The process of reading and writing objects to byte stream called___________

[A] Serialization

B. IO handling

C. Abstraction

D. Deserialization

50. The ability of an object to store data beyond the lifetime of the object is called encapsulation

A. FALSE

[b] TRUE

51. Which of the following would sort all the elements a Properties set, including the defaults?

A. Call the toArray method of Properties and then call Arrays.sort on the result.

[b] Call the sort method of Collections to sort the whole Map (Proerties object).

C. Create a new TreeMaP, Passing in source Properties object to its constructor.

D. Create a new TreeMap and map each key reported by propertyName and its associated value to it.

52. The join() method does not throw an exception when another thread interrupts it

[A] FALSE

B. TRUE

53. Which means of the predefined-charater "\s"

A. a word character

[b] a whitespace character

C. a non whitespace charater

D. a non word character

E. any character

54. Daemon threads are service providers for other threads running in the different process

A. FALSE

[b] TRUE

55. Which syntax is used for the greedy quantifier

A. X??

B. X?+

C. X

[D] X?

56. Choose two CORRECT statements about Thread

A. A process contains one or more threads inside it

[b] A thread is the smallest unit of executable code in an application that performs a particular task

C. A thread has on definite starting point, execution steps and terminating point

[D] Threads can be used for playing sound and displaying images simultaneously

57. This code snippet matches with annotation type

Public @interface TestAnnotion{

String process();

}

A. Full-value or multi-value

[b] Single-Element

C. Marker

58. We can apply generics for which (choose all correct answers)

A. interface

[b] method

[C] class

[D] properties

E. package

59. remove() method returns the value of the queue and removes the head from the queue

A. FALSE

[b] TRUE

60. serialization can save the state of a static or transient variable

[A] FALSE

B. TRUE

61. Regular expression supports a number of special characters that affect the way a pattern is matched. They're called__________

A. character classes

B. string literals

C. classes

[D] metacharacters

Bạn đang đọc truyện trên: Truyen2U.Pro