当前位置:网站首页>Tcp/ip test questions (I)

Tcp/ip test questions (I)

2022-06-25 18:54:00 9JiuJiu

1、 The following agreements belong to TCP/IP Protocol stack , The protocol on the transport layer is ( ).
A.TCP B.HTTP C.SMTP D.DNS
2、 The following agreements belong to TCP/IP The application layer protocols in the protocol stack are ( )
A HTTP B.TCP C.UDP D.IP
3、 The following statement is about UDP The agreement is correct ( )
A. Only unicast is supported B. Connection oriented C. It takes up a lot of system resources 、 Low efficiency D. A very simple agreement , It can be broadcast
4、 Based on TCP In network communication mode , The main tasks of the client and server programs are ( )
A The client program finds a route to the server on the network
B. The client does not have to request 、 Direct transmission
C. The server program receives and processes client requests , Then send the response result to the customer
D. If both the client program and the server guarantee that the data sent will not be lost during transmission
5、 stay Java Network programming , Using client sockets Socket When you create an object , You need to specify the ( )
A Server host name and port B. Server port and file C. Server name and file
D. Server address and file
6、ServerSocket How to monitor accept( ) The return value type of the method is ( )
A.Socket B.Void C.Object D.DatagramSocket
7、 When communication , Which class is used to send and receive datagram sockets ( )
A.FileOutputStream B. DatagramPacket C. DatagramSocket D.BufferedInputStream
8、 Use UDP Socket communication , Commonly used ( ) Class to package the information to be sent .
A.String B.DatagramSocket C.MulticastSocket D.DatagramPacket
9、 The following about Java Threads are right ( )
A. every last Java Threads can be thought of as being composed of code 、 A real CPU And data .
B. There are two ways to create threads , from Thread The creation of inheritance in a class can prevent multiple parent class problems .
C.Thread Class belongs to java.util Package .D. None of the above statements is correct .
10、 In the following options , The key used to define the interface is ( )
A.import B.implements C.interface D.protected
11、 The correct state in the thread life cycle is ( )
A. New state 、 Operation status and termination status
B. New state 、 Running state 、 Blocking state and termination state
C. New state 、 Operational state 、 Running state 、 Blocking state and termination state
D. New state 、 Operational state 、 Running state 、 Recovery state and termination state
12、.java The classes used to create file objects in are ( )
A.File B. Object C. Thread D. Frame
13、java In the program , Use TCP Socket write the socket class of the server program is ( )
A. Socket B. ServerSocket C. DatagramSocket D.DatagramPacket
14、Java What classes are provided to carry out the relevant Internet Address operation .( )
A. Socket B.ServerSocket C. DatagramSocket D InetAddress
15、ServerSocket How to monitor accept() The return value type of is ( )
A. void B. Object C. Socket D. DatagramSocket
17、 When programming with streaming sockets , In order to send data to the other party , Which method to use ( )
A.getInetAddress() B.getLocalPort() C.getOutputStream() D.getInputStream()
18、 Use UDP Socket communication , Which method is used to receive data ( )
A. read() B. receive() C. accept() D. Listen()
19、 To get the source address of the packet , Which of the following statements can be used ( )?
A. getAddress() B. getPort() C. getName() D.getData()
20、 What does not belong to the three elements of network communication is ( )
A.IP Address B. port C. Multithreading D. agreement
21、 Which of the following classes is used for byte buffered output streams ( )
A.FileOutputStream B. FileInputStream C. BufferedOutputStream D.BufferedInputStream
22、 Which of the following classes is used to write byte streams to files ( )
A.FileOutputStream B. FileInputStream C. DatagramSocket D.BufferedInputStream
23、 Which of the following statements is used to name a thread ( )
A.MyThread my1=new MyThread() B. my2.setName(“user02”);
C. my1.start(); D. my2.setPriority(10);
24、 According to the program analysis, which of the following threads is the main thread ( )
tp1.setName(“user01”);
tp2.setName(“user02”);
tp1.setDaemon(true);
tp2.setDaemon(true);
tp1.start();
tp2.start();
Thread.currentThread().setName(“user03”);
A.user01 B. user02 C. user03 D. tp1
25、 That keyword modifies member variables and methods , Subordinate to a class rather than an object ( )
A.default B. static C. public D. protected
26、 Realization Runnable The keyword used by the interface is ( )
A.extends B. implements C. synchronized D. Interrupted
27、 The method used to implement the synchronization lock is ( )
A.extends B. implements C. synchronized D. Interrupted
28、 To get the currently running thread , Which of the following methods can be used ?( )
A.getName() B. Thread.CurrentThread(). B. sleep() D. run()
29、 following ( ) A state that is not part of a thread .( )
A. Ready state B. Running state C. Pending state D. Exclusive state
30、 Using client sockets Socket When you create an object , You need to specify the ( )
A. Server host name and port B. Server port and file C. Server name and file D. Server address and file
31、 The following about Java Threads are right ( )
A. every last Java Threads can be thought of as being composed of code 、 A real CPU And data .
B. There are two ways to create threads , from Thread The creation of inheritance in a class can prevent multiple parent class problems .
C.Thread Class belongs to java.util Package . D. None of the above statements is correct .
32、 Run the following program , What will happen ?( )
public class X extends Thread implements Runable{
public void run(){
System.out.println(“this is run()”);
}
public static void main(String args[]) {
Thread t=new Thread(new X());
t.start();
}
}
A. The first line produces a compilation error B. The sixth line produces a compilation error C. The sixth line will cause a running error D. The program will run and start
33、 In the following options , The key used to define the interface is ( )
A.import B.implements C.interface D.protected
34、. The modifiers that can be used when defining class headers are ( ).
A.private B.static C.abstract D.protected
35、 Which of the following methods cannot be called by any thread at any time ?( )
A.wait() B.sleep() C.yield() D.synchronized(this)
36、 In the following statement about thread priority , The right is ( )
A. The priority of threads cannot be changed B. The priority of a thread is set when the thread is created
C. It can be set at any time after the thread is created D. B and C
37、 The correct state in the thread life cycle is ( )
A. New state 、 Operation status and termination status
B. New state 、 Running state 、 Blocking state and termination state
C. New state 、 Operational state 、 Running state 、 Blocking state and termination state
D. New state 、 Operational state 、 Running state 、 Recovery state and termination state
38、Thread The methods in the class that can run the thread body are ( )
A. start() B. resume() C. init() D. run()
39、 When a program reads a character file , The classes that can take this file as a direct parameter are ( )
A. FileReader B. BufferedReader C. FileInputStream D. ObjectInputStream
40、java.io Bag File Class is ( )
A. Character stream class B. Byte stream class C. Object stream class D. Non stream class
41、 In the following description , The right is ( )
A. stay Serializable Abstract methods are defined in the interface
B. stay Serializable Interface defines constants
C. stay Serializable There are no abstract methods defined in the interface , There are no constants defined
D. stay Serializable Interface defines the member method
42、java The classes used to create file objects in are ( )
A.File B. Object C. Thread D. Frame
43、 Enter a string from the keyboard to create a file object , To judge whether the file object is a directory file or a data file , Which of the following methods can be used ?( )
A.getPath() B. getName() C.isFile() D. isAbsolute()
44、 Which of the following classes does not create objects directly ?( )
A.InputStream B. FileInputStream C. BufferedInputStream D. DataInputStream
45、 When entering multiple characters from the keyboard , In order to avoid the influence of carriage return and line feed , Which of the following flow methods is required ?( )
A.write() B. flush() C. close() D. skip()
46、 Write an object to a file in units of objects , What method should be used ? ( )
A. writeInt() B writeObject() C. write() D.writUTF()
47、 Which of the following classes can write simple data types directly to a file ?( )
A.OutputStream B. BufferedWriter C. ObjectOutputStream D.FileWriter

48、 If a class object can be written to a file as a whole , Which of the following interfaces must be implemented when defining this class ?( )
A.Runnable B. ActionListener C. WindowsAdapter D. Serializable
49、 Which of the following types of data can be written to a file as an object ?( )
A.String B. Frame C. Dialog D. Button
50、File class , The method used to list subdirectories and files under a directory is ( )
A.long length() B. long lastModified() C. String [] list() D. String
51、 The stream classes that can write file data in string units are ( )
A. FileOutputStream B. FileWriter C. BufferedWriter C. OutputStream
52、 The classes that can input logical data to a file are :( )
A. FileOutputStream B. OutputStream C. FileWriter D.DataOutputStream
53、 In thread synchronization , To wake up another waiting thread , Use the following methods ( )
A. sleep() B. wait() C. notify() D. join()
56、 When the thread is created , Its state is ( )
A. Blocked state B. Running state C、 Ready state D、 New state
57、 When a thread calls start() after , Its state is ( )
A. Blocked state B. Running state C、 Ready state D、 New state
58、Thread.sleep() After method call , When the waiting time is not up , The thread is in a state of ( )
A. Blocked state B. Running state C、 Ready state D、 New state
59、 The state that a thread in a new state may directly enter is ( )
A. Blocked state B、 Running state C、 New state D、 End state
60、Thread.sleep() After method call , When the waiting time has come , The thread is in a state of ( )
A. Blocked state B. Running state C、 Ready state D、 New state
61、 When a thread exits due to an exception run() after , Its state is ( )
A. Blocked state B. Running state C、 Ready state D、 End state
62、wait() Method is the method of which class first ?( )
A. Object B. Thread. C. Runnable D. File
63、 If we want to achieve “ First, cache the data to be written to the file into memory , Then write the data in the cache to the file ” The function of the , Which of the following classes is required ?( )
A. FileReader B. OutputStream C. FilterOutputStream D. DataOutputStream
64、 use read() Method to read the contents of the file , Mark the end of the file as ( )
A. 0 B. 1 C -1 D. No mark
65、 Which of the following methods only works on stream classes that use buffering ?( )
A. read() B. write() C skip() D. flush()
66、Java Class provided InetAddress To conduct relevant Internet Address operation .( )
A. Socket B.ServerSocket C. DatagramSocket D InetAddress
67、InetAddress Which method in the class can implement forward name resolution ?( )
A. isReachable() B. getHostAddress() C. getHosstName() D.getByName()
68、 To get the file contents of the remote host , When creating a URL After the object , Which method to use to obtain information ( )
A.getPort() B.getHost C.openStream() D.openConnection()
69、java In the program , Use TCP Socket write the socket class of the server program is ( )
A. Socket B. ServerSocket C. DatagramSocket D.DatagramPacket
70、ServerSocket How to monitor accept() The return value type of is ( )
A. void B. Object C. Socket D. DatagramSocket
71、ServerSocket Of getInetAddress() The return value type of is ( )
A. Socket B ServerSocket D.InetAddress D.URL
72、 When programming with streaming sockets , In order to send data to the other party , Which method to use ( )
A.getInetAddress() B. getLocalPort() C.getOutputStream() D.getInputStream()
73、 Use UDP Socket communication , Which class do you usually use to package the information you want to send ? ( )
A. String B. DatagramSocket C. MulticastSocket D.DatagramPacket
75、 To get the source address of the packet , Which of the following statements can be used ( )?
A. getAddress() B. getPort() C. getName() D.getData()
76、 To use java Program access database , You must first establish a connection with the database , Before establishing a connection , The database driver should be loaded , The statement is ( )
A Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”)
B. DriverManage.getConnection(“”,””,””)
C.Result rs= DriverManage.getConnection(“”,””,””).createStatement()
D. Statement st= DriverManage.getConnection(“”,””,””).createStaement()
77、 To use java Program access database , You must first establish a connection with the database , The statement is ( )
A Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”)
B. DriverManage.getConnection(“”,””,””)
C.Result rs= DriverManage.getConnection(“”,””,””).createStatement()
D. Statement st= DriverManage.getConnection(“”,””,””).createStaement()
78、java After the program is connected to the database , You need to view the data in a table , Which of the following statements is used ?( )
A. executeQuery() B.executeUpdate() C executeEdit() D.executeSelect()
79、java After the program is connected to the database , You need to view the data in a table , Which of the following statements is used ?( )
A. executeQuery() B.executeUpdate() C executeEdit() D.executeSelect()
80、 Column which option is a legal identifier ?( )
A.123 B._name C.class D.first
81、 Which of the following options is Java The debugger , If the compiler returns an error in the program code , It can be used to debug programs ?( )
A.java.exe B.javadoc.exe C.jdb.exe D.javaprof.exe
82、 The following about Frame What is not true about class is ( )
A.Frame yes Window Direct subclass of class B.Frame The object is displayed as a window
C.Frame Is initialized to visible by default D.Frame The default layout manager is BorderLayout
83、 The following Java Which of the common event classes is the mouse event class ?( )
A.InputEvent B.KeyEvent C.MouseEvent D.WindowEvent
84、 Which of the following options can be correctly used to represent octal values 8?( )
A.0x8 B.0x10 C.08 D.010
85、 Which of the following assignment statements is incorrect ?( )
A.float f = 11.1; B.double d = 5.3E12; C.float d = 3.14f ; D.double f=11.1E10f;
86、 stay Applet Of the key methods , Which of the following is to close the browser to release Applet All the resources used ?( )
A.init() B.start() C.paint() D.destroy()
87、 Which of the following is an application platform for large enterprise class container management specialized components ?( )
A.J2EE B.J2ME C.J2SE D.J2DE
88、 stay Java in , Responsible for the execution of byte code interpretation is ( ).
A. Garbage collector B. virtual machine C. compiler D. Multithreading mechanism
89、 In the following narration , The right is ( )
A.Java Language identifiers are case sensitive B. Source file name and public Class names can be different
C. The source file extension is .jar D. In the source file public There is no limit to the number of classes
90、 The following are legal Java The identifier is ( )
A. _cat B. 5books C. +static D.-3.14159
91、 stay Java in , The escape character representing the newline character is ( )
A. \n B. \f C. ‘n’ D. \dd
92、 stay Java in , from Java The compiler automatically imports , Without using... In the program import The imported package is ( )
A. java.applet B. java.awt C. java.util D. java.lang
93、 Which of the following is the correct calculation 42 degree ( angle ) Cosine of ?( )
A.double d=Math.cos(42); B.double d=Math.cosine(42);
C.double d=Math.cos(Math.toRadians(42));
D.double d=Math.cos(Math.toDegrees(42));
94、 The following InputStream Which method in the class can be used to close the flow ?( )
A.skip() B.close() C.mark() D.reset()
95、 Which of the following methods is the method of executing the thread ?( )
A.run() B.start() C.sleep() D.suspend()
97、 stay Java in , The root class of all classes is ( )
A.java.lang.Object B.java.lang.Class C. java.applet.Applet D. java.awt.Frame
98、Java in , use Package Statement when describing a package , The hierarchy of the package must be ( )
A. The same structure as the file B. The same level as the file directory C. Same as file type D. Same size as file
99、 Reading character file Employee.dat when , The class that uses this file as a parameter is ( )
A. BufferReader B. DataInputStream C. DataOutoutStream D. FileInputStream
100、 The following construction methods are called in , The right is ( )
A. Call according to the general method B. Directly called by the user C. Only through new Automatically call D. Called by system

answer :AADCA ACDBC | CABDC CBAC | CAACB BCBDA | BDCCA DCDAD | CACAD BCDAC | CDC DCADC | DACCD DBCBC | DCDA ABABB | CBCBA DABAA | ADCBA ABDC |

原网站

版权声明
本文为[9JiuJiu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206251820491747.html

随机推荐