Tải bản đầy đủ (.docx) (23 trang)

ĐỀ THI LÝ THUYẾT JAVA XỬ LÝ PHÂN TÁN

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (140.57 KB, 23 trang )

Đề 1:
1. Which of the following objects of MVC architecture represents all the data and the
various states of the component?
Model
View
Controller
All of the above.
2. Which of the following is not a type of Container?
Top-level
Bottom-level
General-purpose
None of the above.
3. The JToolBar has a method _________ which can be used to make the edges of
the toolbar buttons invisible.
JFileChooser
setRollover()
addSepartor()
4. The _________ method is used to set the current color of the color chooser.
setColor()
SETCOLOR()
Setcolor()
5. The methods isSelectedIndex() and isSelectionEmpty() are members of the
________ class.
JColor
JList
Jbox
6. The ______ method of JComboBox is used to retrieve the item at the specified
index.
insertItemAt()
getItemAt()
removeItemAt()


7. The getMaximumRowCount() method of __________ is used to retrieve the
maximum number of items the combo box can display without a scrollbar.
JList
JColorChooser
JComboBox
8. In JTable, headers and footers can be specified with an object of____________
class.
setTable
MessageFormat
TextFormat
9. The _________ class has methods to parse and convert text to a date.
SimpleDateFormat
DateFormat
DateTimeFormat
10. The ________ class cannot be instantiated as it is an abstract class.
URL connection
URL
ServerSocket class
11. The _________ method is used to retrieve the setting of the connection timeout
of the URL in milliseconds.
getContentType()
getConnectTimeout()
setConnectTimeout()
12. A timeout value of zero of the setConnectTimeout() method indicates
Infinite timeout
Opening a communication link to the resource referenced
An exception raised
13. Instances of the ______ class can be used to read from and write to the
resource referred by the URL.
URL

InetAddress
Connection
URLConnection
14. An instance of the Socket class represents the _________ side of the connection.
server
client
application
I/O
15. A ServerSocket instance binds itself to a __________ and then waits and listens
for client requests to establish connections.
port
socket
IP address
URLConnection
16. The remote object in an RMI application must extend from the
_______________ class.
UnicastRemoteObject
Remote
RemoteException
UnicastServerObject
17. _________ application can be used to start the naming service on the server.
registry.exe
namingregistry.exe
rmiregistry.exe
registryservice.exe
18. The server application has to bind the remote object with a _____________ in
the registry.
reference
name
remote reference

entry
19. A javax.mail.Session object can be created by invoking the static ________
method.
getInstance()
getProperties()
getSession()
initiateSession()
20. To retrieve a message from the mail server, one has to access the _________
first.
Session
Address
MIMEMessage
Store
21. __________ is the class used to contain email message.
Store
Inbox
Folder
Message
22. An instance of the ServerSocket class is used to represent the ________ side of
the two-way communication.
server
client
application
I/O
23. A JFrame and a JApplet have a _______ layout by default.
Border
Card
Flow
Grid
24. Swing is a framework based on the Model-View-Controller (MVC) architecture in

comparison to AWT, which was just a toolkit.
True
False
25. Which of the following describes Heavyweight components?
Platform dependent
Abstract Window Toolkit
GUI based application
Platform independent
Đề 2:
1.Successful translation of the source files in the desired language is very difficult.
A.True. *
B.False.
2.A locale is an identifier for a particular combination of language and redion.
A.True. *
B.False.
3.The numberFormat class is used to create locale-specific formats for which of the
following?
a.Numbers.
b.Currencies.
c.Percentages.
d.Date
A.a,b,c. *
B.b,c,d.
C.a,b,d.
D.a,b,c,d.
4.Which of the following layers in TCP deals with opening and mainaining connections as
well as ensures the packets are transmitted and received.
A.I
B.II *
C.III

D.IV
5.Which of the following is not of RMI architecture?
A.Stub and Skeleton.
B.Remote Reference.
C.Transport Protocol.
D.None of the above. *
6._____ is a top-level constainer.
A.JDialog. *
B.JPanel.
C.JLayeredPane.
D.JDesktopPane.
7._____ constructor creates a horizotal slider bar with the range 0 to 100 and an initial
value of 50.
A.JSlider(int orientation)
B.JSlider(int value)
C.JSlider() *
D.JSlider(int min, int max, int value)
8.Which of the following are the advantages of using FlowLayout Manager?
a.Simple to use.
b.Component placed in the center of the contain by default.
c.Suitable for JApplet which runs as part of a Web Page.
d.Complex alignment can be easily achieved.
A.a,b,c. *
B.b,c,d.
C.a,c,d.
D.a,b,c,d.
10.A JPopupMenu is more convenient than the standard menus because it involves more
mouse mevements.
A.True
B.False. *

11.The addSeparator() method adds a separator at the _____ of the pop-up menu.
A.Beginning.
B.End.
C.Center. *
D.Anywhere
12.The JFileChooser has which of the following methods?
a.showDialog()
b.showSaveDilog()
c.showOpenDilog()
d.ShowNewDialog()
A.a,b,c. *
B.b,c,d.
C.a,c,d.
D.a,b,c,d.
13.Which of the following methods of the JFileChooser returns an instance of the File
representing the file selected from the dialog box ?
A.getSelectedFile() *
B.getCurrenDirectory()
C.getFile()
D.All of the above.
14.Which of the following constructors of the JToolBar constructs a toolbar with the default
horizotal orientation ?
A.JToolBar() *
B.JToolBar(int orientation)
C.JToolBar(String title)
D.None of the above.
15.JList is a class used to dislay a group of items. The items in a JList can be displayed in
one or more columns.
A.True.
B.False. *

16.Which of the following selectModes of List class allows selecting a contigous item?
A.SINGLE_SELECTION
B.MULTIPLE_INTERVAL_SELECTION
C.SINGLE_INTERVAL_SELECTION
D.All of the above
17.Which of the following are the important methods of a JComboBox ?
a.setEdittable()
b.setSelectedIndex()
c.setSelectedItem()
A.a,b
B.b,c
C.a,c
D.a,b,c *
18.A JTable has which of the following distinct parts?
a.Column Header.
b.Row Header.
3.Data
A.a,b
B.b,c
C.a,c *
D.a,b,c
19.The divider in JSplitPane can be dragged to specify how much of the total area is to be
given to a component.
A.True. *
B.False
20.An internationalized and localized program has which of the following benefits?
a.Same executable application can run worldwide.
b.Textual elements for GUI components are not hard-coded in the program.
c.Support for new language requires only recompilation.
d.Internationalized programs are localized quickly.

A.a,b,c
B.b,c,d
C.a,b,d
D.a,b,c,d *
Đề 3:
1.Successful translation of the source files in the desired language is very difficult.
Việc dịch thành công của các nguồn tập tin trong các ngôn ngữ là rất khó khăn.
A.True. *
B.False.
2.A locale is an identifier for a particular combination of language and redion.
Locale là một định danh cho một sự kết hợp đặc biệt của ngôn ngữ và redion.
A.True. *
B.False.
3.The numberFormat class is used to create locale-specific formats for which of the
following?
Lớp NumberFormat được sử dụng để tạo ra các định dạng miền địa phương cụ thể nào?
a.Numbers Con số.
b.Currencies Tiền tệ.
c.Percentages Tỷ lệ phần trăm.
d.Date ngày
A.a,b,c. *
B.b,c,d.
C.a,b,d.
D.a,b,c,d.
4.Which of the following layers in TCP deals with opening and mainaining connections as
well as ensures the packets are transmitted and received.
Các lớp nào sau đây trong giao dịch TCP mở và kết nối mainaining(???) tương tự như việc
đảm bảo các gói dữ liệu được truyền và nhận.
A.I
B.II *

C.III
D.IV
5.Which of the following is not of RMI architecture?
Điều nào sau đây là không phải của cấu trúc RMI?
A.Stub and Skeleton.
B.Remote Reference.
C.Transport Protocol.
D.None of the above. *
6._____ is a top-level constainer.
__________là một container cấp cao nhất.???
A.JDialog. *
B.JPanel.
C.JLayeredPane.
D.JDesktopPane.
7._____ constructor creates a horizotal slider bar with the range 0 to 100 and an initial
value of 50.
Constructor______ để tạo ra một thanh trượt ngang với phạm vi 0 đến 100 và giá trị ban
đầu là 50.
A.JSlider(int orientation) định hướng
B.JSlider(int value) Giá trị
C.JSlider() *
D.JSlider(int min, int max, int value) nhở nhất,lớn nhất,giá trị
8.Which of the following are the advantages of using FlowLayout Manager?
Câu nào sau đây là những lợi thế của việc sử dụng flowLayout Manager?
a.Simple to use Dễ sử dụng
b.Component placed in the center of the contain by default Thành phần trong nó được đặt
mặc định ở trung tâm.
c.Suitable for JApplet which runs as part of a Web Page Phù hợp cho trình JApplet mà chạy
như một phần của một trang web.
d.Complex alignment can be easily achieved Dễ dàng liên kết các thành phần phức tạp.

A.a,b,c. *
B.b,c,d.
C.a,c,d.
D.a,b,c,d.
10.A JPopupMenu is more convenient than the standard menus because it involves more
mouse mevements.
JPopupMenu là thuận tiện hơn so với các trình tiêu chuẩn đơn bởi vì nó liên quan đến việc
di chuyển chuột nhiều hơn.
A.True
B.False. *
11.The addSeparator() method adds a separator at the _____ of the pop-up menu.
AddSeparator () là hàm bổ sung thêm một khoảng cách _____ của menu pop-up.
A.Beginning bắt đầu
B.End kết thúc
C.Center. * Trung tâm
D.Anywhere bất kì chỗ nào
12.The JFileChooser has which of the following methods?
JFilechooser có các hàm nào sau đây?
a.showDialog()
b.showSaveDilog()
c.showOpenDilog()
d.ShowNewDialog()
A.a,b,c. *
B.b,c,d.
C.a,c,d.
D.a,b,c,d.
13.Which of the following methods of the JFileChooser returns an instance of the File
representing the file selected from the dialog box ?
Các hàm nào sau đây của JFileChooser trả về một trường hợp của các tập tin đại diện cho
các tập tin được chọn từ hộp thoại?

A.getSelectedFile() *
B.getCurrenDirectory()
C.getFile()
D.All of the above.
14.Which of the following constructors of the JToolBar constructs a toolbar with the default
horizotal orientation ?
Các Constructer nào sau đây của JToolBar xây dựng một thanh công cụ với định hướng
ngang mặc định?
A.JToolBar() *
B.JToolBar(int orientation)
C.JToolBar(String title)
D.None of the above.
15.JList is a class used to dislay a group of items. The items in a JList can be displayed in
one or more columns.
JList là một lớp được sử dụng để hiển thị một nhóm các Item. Các Item trong một JList có
thể được hiển thị trong một hoặc nhiều cột.
A.True.
B.False. *
16.Which of the following selectModes of List class allows selecting a contigous item?
Các selectModes của lớp Danh sách nào sau đây cho phép chọn gần kề 1 Item?
A.SINGLE_SELECTION
B.MULTIPLE_INTERVAL_SELECTION
C.SINGLE_INTERVAL_SELECTION
D.All of the above
17.Which of the following are the important methods of a JComboBox ?
Những hàm nào sau đây là hàm quan trọng của một JComboBox?
a.setEdittable()
b.setSelectedIndex()
c.setSelectedItem()
A.a,b

B.b,c
C.a,c
D.a,b,c *
18.A JTable has which of the following distinct parts?
JTable có của các phần riêng biệt sau đây?
a.Column Header.
b.Row Header.
3.Data
A.a,b
B.b,c
C.a,c *
D.a,b,c
19.The divider in JSplitPane can be dragged to specify how much of the total area is to be
given to a component.
Việc chia vị trí trong JSplitPane có thể được kéo để xác định tổng diện tích được trao cho
một thành phần là bao nhiêu.
A.True. *
B.False
20.An internationalized and localized program has which of the following benefits?
Một chương trình quốc tế và địa phương có những lợi ích nào sau đây?
a.Same executable application can run worldwide Thực thi cùng một ứng dụng có thể chạy
trên toàn thế giới.
b.Textual elements for GUI components are not hard-coded in the program Các yếu tố văn
bản cho các thành phần giao diện đồ họa không mã hóa cứng trong chương trình.
c.Support for new language requires only recompilation mới chỉ Hỗ trợ ngôn ngữ yêu cầu
biên dịch lại.
d.Internationalized programs are localized quickly Chương trình quốc tế được bản địa hoá
một cách nhanh chóng.
A.a,b,c
B.b,c,d

C.a,b,d
D.a,b,c,d *
Đề thi portal Aprotrain – aptech (DCJ)
hp://hsvforum.vn/threads/7156-dap-an-de-thi-portal-aprotrain-aptech-mon-dcj
Đề thi lý thuyết DCJ:
1. Which of the following statements about the reply() method of the message class is true ?
1.The reply() method returns a message properly configured to reply to the sender or all recepients of the message.
2. The reply() method automatically adds "Re:" to the subject line of the message .
3. The reply() method adds the original text of the message edited by the user to body of the message .
4. The message object returned by the reply() method is a new Message object.

1. 1,2,3
2. B. 1,2,4
1. 2,3,4
2. 1,3,4

2 . Identify the correct answer :
Statement 1 : The parse() method of the InternetAddress class is used to check if the specified addresses are valid .
Statement 2 : The static methods of the javax.mail Transport class throw a SendFailedException of any of the Recepient's
address is found to be invalid .
1. Only Statement 1 is true
2. B. Only Statement 2 is true
1. Both Statement 1 and 2 are true
2. Both Statement 1 and 2 are false

3. Which of the following statement is false about Model-View-Controller architecture ?
1. The Model represents all the data and the various states of the component.
2. The View depicts the graphical part on the screen.
3. The Controller is responsible for determining whether the component should react any input events from input
devices such as the keyboard or mouse .

4. A Model is bound to a specific View or Controller .

1. 1
2. 2
3. 3
4. D. 4

4. Swing provides the class to create filters .
1. javax.swing.FileFilter
2. javax.swing.filechooser.Filter
3. C. javax.swing.filechooser.FileFilter

5. A …………… is dockable only if the container it belongs to has a BorderLayout manager .
1. A. JToolBar
1. JMenuBar
2. JCheckBoxMenuItem
3. JMenu

6. The method is used to make the toolbar dockable .
1. A. setFloatable()
2. setDockable()
3. setDock()
4. setToolDockable()



7. The currency of a particular country can be displayed in ……… class .
1. MessageFormat
2. B. NumberFormat
1. CountryFormat

2. Locale

8. Instances of the class can be used to read from and to write to resource referenced by the URL.
1. URL
2. InetAddress
3. Connection
4. D. URLConnection

9. An instance of the Socket class represents the side of the connection.
1. server
2. B. client
1. application
2. I/O

10. Which of the following are not the methods of JAppletclass ?
1. init() d
2. start() d
3. sleep()
4. paint() d
5. exit()

1. 1,2,3
2. 2,4,5
3. 4,5
4. D. 3,5
1. 1,2,4

11 . Which of the following features are true regarding lightweight components ?
1. They are platform independent .d
2. They do not consume extra overheads in terms of memory and execution time. d

3. They render themselves with pure Java code.
4. They depend on external native language code like C/C++ which forms the peer equivalent .

1. 1,2,3,4
2. 2 and 4
3. C. 1,2 and 3
1. 1,3 and 4

12 . Which of the following methods are supported by JPopupMenuclass ?
1. publicJMenuItem add(JMenuItem item)
2. public void addSeparator()
3. public void setDefaultLightWeightPopupEnabled()
4. public static void setDefaultLightWeightPopupEnabled(boolean Lightweight)

1. 2,3 and 4
2. 2 and 3
3. 1 and 4
4. D. 1,2 and 4

13. Which of the following statements are true about Properties Files ?
Statement 1 : The value in a key-value pair in a properties file is translated into the desired language .
Statement 2 : The keys in a properties file are always in the English language.
1. A. Only 2 is true
1. Both 1 and 2 are false
2. C. Only 1 is True
1. Both 1 and 2 are True

14. Which of these components reside on the server side of an RMI application ?
1. Stub
2. Implementation Class

3. Skeleton
4. Remote Interface.

1. 1,2,3
2. 1,2,4
3. C. 2,3,4
1. 1,4

15 . constructor creates a horizontal slider bar with the range 0 to 100 and an initial value of 50 ?
1. A. JSlider(int orientation)
2. JSlider(int value)
3. C. JSlider()
4. JSlider(intmin,intmax,int value)

16. The parent of a dialog box is typically the
1. Jdialog
2. JPanel
3. C. JFrame
1. JOptionPane//cai nay

17. A JFrame and a JApplet has a layout by default.
1. A. Border
1. Card
2. Flow
3. Grid

18. The method………… invokes the getPreferredSize() method of the frame to determine the best size for laying out the
components .
1. getSize()
2. setSize()

3. preferredSize()
4. D. pack()

19. A is a component which displays its data in a hierarchical way .
1. JTable
2. B. JTree
1. JMenuList
2. JMenuItem




20. The URL string is made up of the and parts .
A Resource Locator,Uniformity Checker
B. Resource Locator, Protocol Identifier
C. Protocol Decoder, Resource Name
D. Protocol Identifier, Resource Name

21. The constructions of the URL class throw a ……. if no protocol is specified .
1. NullPointerException
2. InvalidArgumentException
3. C. MalformedURLException
1. InvalidProtocolException

22. The method of the URL class returns the IP address enclosed in square brackets.
1. getFile()
2. getIP()
3. C. getHost()
4. getPath()


23. A ServerSocket instance binds itself to a and then waits and listens for client requests to establish connections .
1. A. port
1. socket
2. IP address
3. URLConnection

24. Arrange the steps to use the MessageFormat class in the correct sequence .
1. Create a MessageFormat instance
2. Identify the variable in the message.
3. Apply and format the pattern using the MessageFormatinstance .
4. Create a template .
5. Create an object array for containing the variable arguments.

1. 1,2,3,4,5
2. 2,4,1,5,3
3. C. 2,4,5,1,3
1. 4,1,2,5,3

25. Which of the following statements are true about Swing ?
1. Swing Buttons and Labels can display images in addition to textual captions .
2. Border drawn around most of the Swing components can be changed.
3. The MVC architecture does not allow to represent and perform the components functionality.
4. Swing is based on the Model-View-Controller Architecture .

1. 1 and 2
2. B. 2 ,3 and 4
1. C. 1,2 and 4
2. 3 and 4







26. Which of the following constructors can be used to create a FlowLayoutManager .
1. FlowLayout(inthorizontal_gap,intvertical_gap)
2. FlowLayout()
3. FlowLayout(int alignment)
4. FlowLayout(intalignment,inthorizontal_gap,intvertical_gap)

1. 1 and 2
2. 3 and 4
3. C. 2,3 and 4
1. 1,3 and 4

27. A component allows only the characters specified in the mask pattern to be entered .

1. A. JFormattedTextField
1. JTextField
2. JPasswordField
3. JformattedField

28. A is similar to a JMenuItem with the additional feature and deselecting them .

1. A. JCheckBoxMenuItem
1. JCheckBoxMenu
2. JMenuItem
3. JMenuList

29 . The JColorChooser has a method which returns an object of the ColorSelectionModel Interface .


1. A. getSelectedModel()
2. getModelSelection()
3. getSelectionModel()
4. getSelection()

30. Arrange the steps to create a message using the MimeMessage object in the correct order
1.
1. Set the content types of the message
2. Set the content of the message
3. Set the Attributes required
4. Create an empty message object from a session

4,3,1,2
31. Which of the following are the methods of JScrollPaneclass ?
1. public void setCorner(String key, Component corner)
2. public void setHorizontalScrollBarPolicy(String key)
1. 3. public void setVerticalScrollBarPolicy(int policy)
2. 4. public void setHorizontalScrollBarPolicy(int policy)
3. public void setVerticalScrollBarPolicy(int key)
1, 3 ,4
32. The _____ package has a class Color to create objects representing colours and their shades.
1. javax.swing
2. java.awt
1. java.awt.colorchooser
2. javax.swing.colorchooser





33. Whenever you select an item from the combobox the _____ method of ItemListener is invoked .
1. ItemSelected()
2. isSelected()
1. ItemAdded()
2. 4. itemStateChanged()

34. …… provides a unique number for every character irrespective of platform,program or language .
A. ByteCode
B. ASCII Encoding
C. Unicode
D. protected nested class

35. java.util.locale class object represents a specific geographical ,political, cultural region.Which of the following are valid
constructor for the Locale
1.public Locale()
2.public Locale(String country)
3.public Locale(String language)
4.public Locale(String language,String country)
5.public Locale(String country,String language)

1. 1,5
2. 2,3,4
1. C. 3,4
1. 2,5

36. Which of the following protocols is not used for sending and receiving email ?

1. IMAP
2. MIME
3. SMTP

4. POP

1. 1
1. B. 2
1. 3
2. 4

37. is a Java program which runs as part of a web pages

1. Swing
1. B. Applet
1. Java Virtual Machine
2. Remote Method Invocation

38. The class is used to convert sentences from one locale to another without introducing grammatical errors .

1. MessageFormat
2. NumberFormat
3. CountryFormat
4. Locale

39. An instance of the ServerSocket class is used to represent the side of the two-way communication
1. A. server
1. client
2. application
3. I/O

40. Identify the correct statements with JList ?
Statement 1 : A JList does not support scrolling inherently.
Statement 2 : A JList allows you to choose only one item.


1. A. Only 1 is true
1. Both 1 and 2 are false
2. Only 2 is true
3. Both 1 and 2 are true

×