♫♥♫...:::Nhóm Học Sinh Fpt-Aptech:::...♫♥♫
Đăng Kí Thanh Viên Nào Mọi Người

Join the forum, it's quick and easy

♫♥♫...:::Nhóm Học Sinh Fpt-Aptech:::...♫♥♫
Đăng Kí Thanh Viên Nào Mọi Người
♫♥♫...:::Nhóm Học Sinh Fpt-Aptech:::...♫♥♫
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.
Đăng Nhập

Quên mật khẩu

Latest topics
» Tài Liệu java và Dream8
de 1 java2 I_icon_minitimeMon Dec 02, 2013 6:22 pm by hoangthai0302

» [Tham khảo] Đề thi BDW FPT
de 1 java2 I_icon_minitimeWed Aug 14, 2013 8:08 pm by yowisu

» Nhận giúp làm đồ án, project cuối kỳ, bài tập lớn cho sinh viên học lập trình dotNet tại Hà Nội
de 1 java2 I_icon_minitimeMon Jul 08, 2013 11:44 am by aiglevnpro

» Đây là tài liệu học RDBMS mời download
de 1 java2 I_icon_minitimeFri Nov 09, 2012 9:51 am by laiconghung

» [Tham Khảo] Ass 4 của tui :)
de 1 java2 I_icon_minitimeFri Oct 26, 2012 10:21 pm by dat21892

» Giới thiệu Đại học FPT-Greenwich
de 1 java2 I_icon_minitimeThu Oct 11, 2012 2:02 pm by comnhom.it

» De Ly Thuyet 134 cau day. Chuan luon do cua aptech nha
de 1 java2 I_icon_minitimeTue Jun 26, 2012 10:33 pm by PhucBach

» THÔNG BÁO CƠ HỘI NGHỀ NGHIỆP
de 1 java2 I_icon_minitimeTue Jun 05, 2012 10:48 am by yenns

» Khóa học miễn phí thiết kế diễn đàn bằng Vbulletin tại ICODE
de 1 java2 I_icon_minitimeTue May 01, 2012 12:15 pm by mr_icode


de 1 java2

3 posters

Go down

de 1 java2 Empty de 1 java2

Bài gửi by loptruong Tue Mar 15, 2011 2:01 pm

Câu 1: What will be the result of trying to compile and run the following code ?
public class MyClass {
public static void main(String[] args){
StringBuffer sb = new StringBuffer("have a nice day");
sb.setLength(6);
System.out.println(sb);
}
}

A. The program will print "have a" when run
B. The code will fail to compile since there is no method named setLength() in the StringBuffer
C. The program will print "ce day" when run
D. The program will print "have a nice day" when run
Câu 2: tries to match the input sequence against the pattern starting from beginning.
A. boolean lookingAt()
B. boolean find()
Câu 3: The annotation type is used to determine the longevity of the information.
A. @Retention
B. @Documented
C. @Deprecated
D. @Override
Câu 4: Invoke methods using refleftion.
A. getField() on class
B. NewInstance() on Constructo
C. invoke()
D. set()
Câu 5: Which will be the result of trying to compile and run the Expression : (Math.random()*4) ?
A. The probability that the number 0,1,2 or 3 might be returned is equal
B. A negative number might be returned .
C. The number 4 is returned .
D. The number 0 will be returned .
Câu 6: Which statements are true?
- 3 choices
A. Reflection API cannot manipulate classes.
B. Reflection API is used to get and set values in an array
C. Reflection API induces code into a particular set of classes during execution
D. Reflection API retrieves the object and its interface for examination
Câu 7: Which statements are true ?
- 3 choices
A. Values of arrays can be retrieved during runtime
B. Array can be identified at runtime.
C. Arrays can not be created at runtim
D. Values to elements can be assigned to arrays at runtime
Câu 8: A......…..method when invoked for an object ,acquires a….......for the object before comme . ?
A. start(),reference
B. syschronized,lock
C. run(),lock
D. notify(),reference
Câu 9: Annotations consist of names and have no value associated with it. It consist of the annotaion name and no additional data.
A. Single - Value Annotations.
B. Maker Annotations.
C. Full Annotations
Câu 10: Which methods of the Matcher class do not actually attempt to match an input sequence against a pattern ?
A. find()
B. start()
C. matches()
D. lookingAt()
Câu 11: The reflection API corresponds to classes, Interfaces and objects in JVM.
A. True
B. False
Câu 12: They are extra informations associated with particular section of a document or with the whole document.They provide information about an existing data and can be used with any web document.
A. Threads
B. Annotation
C. Regular Expression
D. Refletion
Câu 13: Annotation can not be used to which items:
A. Classes,Package
B. Interfaces,Local Variable
C. Global variables
D. Methods,Constructors
Câu 14: This tries to match the entire input sequence against the pattern.
-1 choice.
A. boolean find()
B. nt end()
C. boolean matches()
D. boolean lookingAt()
Câu 15: So as to create a pattern object, ...........method is invoked
A. compile()
B. matcher()
C. boolean matches()
D. int start()
Câu 16: Be Known as single - element, It consists of single value. It can be represented as data= value pair or value within the parenthese.
A. Maker Annotations.
B. Single - Value Annotations
C. Full Annotations.
Câu 17: The use of annotation type indicateds that the markered element should no longer be used.
A. @Deprecated
B. @Override
Câu 18: Which is the most suitable data-structure to store small amount of the data for rapid access that need not be sorted or checked for uniqueness?
A. an array
B. LinkedList
C. HashMap
D. TreeSet
Câu 19: Which of the following statements should be inserted at line 4 so that the following code will compile properly ?

Import java.util.*;
class MyClass{
public static void man(String[] args{
// line of code to be inserted here
x.add("one");
.....
.........}
}

A. HashSet x = new HashSet();
B. A.List x = new LinkedList();
C. ArrayList x = new ArrayList();
D. LinkedList x = new LinkedList();
Câu 20: Create objects using prameterized constructors
A. NewInstance() on Constructor
B. set()
C. getField() on class
D. invoke()
Câu 21: What will be the output of compiling and running the following code?
HashSet hs = new HashSet();
hs.add(“apples”);
hs.add(“oranges”);
HashSet s = new HashSet();
s=hs;
System.out.println(s);

A. prints [oranges, apples]
B. compiler error.
C. ClassCastException is thrown at runtime.
D. prints [apples, oranges].
Câu 22: Create objects using default constructors?
A. set()
B. getField() on class
C. NewInstance() on class
D. NewInstance() on Constructor
Câu 23: Annotations are comments, notes, explainations, or external remarks attached to a web document.
A. True
B. False
Câu 24: import java.lang.reflect.*;
class Hello {
public void sayHello(){
System.out.println ("Hello!");
}
}

Which statement is incorrect?

A. Hello x = (Hello) h.getDeclaredConstructor().newInstance();
B. None of above
C. Hello x = (Hello) h.newInstance();
D. Hello x = (Hello) h.getConstructor().newInstance();
Câu 25: returns the start index of the previous match.
A. int start()
B. int end()
Câu 26: This Annotation should not be used on classes, interfaces, package, or constructors. It should be used on method.
A. @Documented.
B. @suppressWarnings
C. @Deprecated
D. @Override
Câu 27: What will be the result of trying to compile and run the following code ?

import java.io.*;
class MyInput {
public static void main(String[] args){
MyInput objInput = new MyInput();
objInput.go();
}

public void go() {
try {
DataInputStream dis = new DataInputStream(System.in);
dis.read();
}
catch(Exception e) {}
System.out.println ("Continue.");

}
}

A. The code will compile and run to completion without output
B. The code will not compile because System.in is not a valid constructor for DataInputStream .
C. The code will not compile because System.in is a static class.
D. The code will run and pause until a key is hit
Câu 28: Which statements are true?
- 3 choices
A. Parameters in annotation can be initialized with arrays of values
B. Parameters in annotation are declared as a fields in a class
C. Parameters in annotation types may defne default values for some members
D. Parameters in annotation can have null values
Câu 29: Which of the following would cause a compile time error ?
A. Class c = boolean.getClass();
B. Class c = Boolean.class;
C. Class c = "boolean".getClass();
D. Class c = Class.forName(java.lang.Interger);
Câu 30: This is matched with a character sequence string. This is called as input Sequence.
A. Pattern Class(
B. Matcher Class
Câu 31: Which of the following details are not retrieved when a class is examined?
A. Class name
B. Package Information
C. Constructors
D. Class Field
Câu 32: Which of the following constructors is not a valid constructor for the class declared as follows:
class Generics()

A. public Generics(){}
B. public Generics(){}
C. public Generics(T t){}
D. public Generics(){}
Câu 33: Which of the following statements is true ?
A. A deadlock situation will not occur if the wait() / notify() mechanism is used .
B. The wait() method can be overloaded to accept a duration .
C. Both the wait () and sleep() can throws a runtime exception .
D. Both wait() and notify() methods can be called from an unsynchronized context .
Câu 34: The following code create a thread using Runnable object .
Runnable objRunnable = new MyThread();
Thread t1 = new Thread(objRunnable);
Which of the following classes can be used so that the above code compiles correctly ?

A. public class MyThread extends Runnable { public void run(){}}
B. public class MyThread implements Runnable{ public void start(){}}
C. public class MyThread implements Runnable { public void run(){} }
D. public class MyThread extends Object { public void run()}
Câu 35: A thread can be created by extending the Thread class .Which of the following methods are defined in the class Thread ?
A. start() and run()
B. wait(),notify() and run()
C. start(),wait(),notify() and run()
D. run() and terminate()
Câu 36: An Annotation declaration consits of ...........followed by th anotation type.
1 choice.
A. @@
B. Data Type
C. Character
D. @
Câu 37: public interface MyInterface {
public void doStuff();
}
What would be the exception thrown if the following line of code is used in the program ?

MyInterface.class.getConstructor(new Class[] {});

A. java.lang.NoSuchMethodException
B. java.lang.ClassCastException
C. No exception is thrown
D. java.lang.NoAvailableConstructorException
Câu 38: Which statements are true?
- 2 Choices.
A. Parameters should be associated with method declarations
B. Return type of method declaration should be either boolean, String,enum,Class or array of the above types.
C. Annotation name should begin with @ symbol followed by the keyword interface and the annotation name
D. Return type of method declaration should be either primitive, String,enum,Class or array of the above types
Câu 39: Annoation is used to indicated that the marker element should not be used. The compiler will generate a warning whenever we use this item.
A. @Override
B. @deprecate
C. @Interface
D. @suppressWarnings
Câu 40: The following code will give
1: Byte b1 = new Byte("127");
2:
3: if(b1.toString() = = b1.toString())
4: System.out.println("True");
5: else
6: System.out.println("False");

A. Depends on the particular implementation of the Java Virtual Machine
B. Prints "True"
C. Prints "False".
D. Compilation error, toString() is not avialable for Byte.
Câu 41: Which of the following fields or methods does not belong to the File class ?
A. dirname
B. separator
C. getName()
D. getParent()
Câu 42: Assign field values using reflection.
A. set()
B. invoke()
C. getField() on class
D. NewInstance() on Constructor
Câu 43: Which expression will extract the substring "cas" from the string defined by String ="cacaso"?
A. str.substring(2,2)
B. str.substring(3,2)
C. str.substring(2,5)
D. str.substring(2,3)
Câu 44: This annotaion gives us permission to do selective suppression of warnings within particular code sections.
A. @suppressWarnings
B. @Interface
C. @Override
D. @Documented.
Câu 45: What will be the result of trying to compile and run the following piece of code?
public static void doIt(){
Set set = new TreeSet();
set.add(“2”);
set.add(3);
set.add(“1”);
Iterator it = set.iterator();
while(it.hasNext()){
System.out.println(it.next() + “ ”);
}
}

A. The method will compile with warnings but throw an exception at runtime.
B. The method will print three numbers but the order cannot be determined.
C. The method fails to compile.
D. The method will print 1,2.
Câu 46: Matcher Class does not have any constructors.
A. True
B. False
Câu 47: It consists of multiple data mambers. Each member should be represented by data=value pair.
A. Single - Value Annotations
B. Maker Annotations.
C. Full Annotations
Câu 48: What is the output of compiling and running the following code ?
Interface Storable{
void store();
}
class File implements Storable{
@Override...
Public void store() {}
}

A. The compiler gives an error depicting that the File.store() method does not override any method from its superclass .
B. The code compiles but with a warning saying that it uses a deprecated API.
C. The code compiles and runs normally
D. The code compiles and gives a warning at runtime.
Câu 49: What will be the output of the trying to compile and run the following program ?

public class Task1 extends Thread {
String str;
public Task1(String s){str= s};
public void run(){
System.out.println

A. The program fails to compile .
B. The program compiles and prints Hello and World in no pre-determined order .
C. The program compiles and prints Hello and World in that order when it runs .
D. The program compiles and terminates without and output when run .
Câu 50: Retrieve field values using reflection.
A. getField() on class
B. invoke()
C. NewInstance() on Constructor
D. set()

Đáp án

Đáp án câu 1 : A
Đáp án câu 2 : A
Đáp án câu 3 : A
Đáp án câu 4 : C
Đáp án câu 5 : A
Đáp án câu 6 : C
Đáp án câu 7 : B
Đáp án câu 8 : D
Đáp án câu 9 : B
Đáp án câu 10 : C
Đáp án câu 11 : A
Đáp án câu 12 : B
Đáp án câu 13 : C
Đáp án câu 14 : C
Đáp án câu 15 : A
Đáp án câu 16 : B
Đáp án câu 17 : A
Đáp án câu 18 : A
Đáp án câu 19 : C
Đáp án câu 20 : A
Đáp án câu 21 : B
Đáp án câu 22 : C
Đáp án câu 23 : A
Đáp án câu 24 : B
Đáp án câu 25 : A
Đáp án câu 26 : D
Đáp án câu 27 : A
Đáp án câu 28 : A
Đáp án câu 29 : C
Đáp án câu 30 : A
Đáp án câu 31 : B
Đáp án câu 32 : C
Đáp án câu 33 : A
Đáp án câu 34 : C
Đáp án câu 35 : D
Đáp án câu 36 : D
Đáp án câu 37 : D
Đáp án câu 38 : C
Đáp án câu 39 : B
Đáp án câu 40 : C
Đáp án câu 41 : A
Đáp án câu 42 : A
Đáp án câu 43 : C
Đáp án câu 44 : A
Đáp án câu 45 : B
Đáp án câu 46 : A
Đáp án câu 47 : C
Đáp án câu 48 : C
Đáp án câu 49 : D
Đáp án câu 50 : A

loptruong
Khỉ Trưởng Lão
Khỉ Trưởng Lão

Tổng số bài gửi : 19
Join date : 23/09/2010

Về Đầu Trang Go down

de 1 java2 Empty Re: de 1 java2

Bài gửi by hieuhiti Sat Apr 23, 2011 7:06 am

đề lúc nào zậy daika hjhj

hieuhiti
Khỉ Bảo Bảo
Khỉ Bảo Bảo

Tổng số bài gửi : 2
Join date : 28/10/2010

Về Đầu Trang Go down

de 1 java2 Empty Re: de 1 java2

Bài gửi by pe lun Sun Jun 05, 2011 1:54 pm

pak" , cho e hỏi cái đề này có đúng k zi . Đề thi 26 câu sao có 50 câu lun =,=" . nghi quá , e sắp thi môn này , thấy màu ghia quá >"< . Help me !!!! No

pe lun
Khỉ Trưởng Lão
Khỉ Trưởng Lão

Tổng số bài gửi : 15
Join date : 28/10/2010
Age : 32
Đến từ : Gia Lai

Về Đầu Trang Go down

de 1 java2 Empty Re: de 1 java2

Bài gửi by Sponsored content


Sponsored content


Về Đầu Trang Go down

Về Đầu Trang


 
Permissions in this forum:
Bạn không có quyền trả lời bài viết