Sample Questions Best site for GRE, LSAT, SAT, GMAT, TOEFL, CCNA, CCSA and interview sample questions  

Technical Sample Questions : C |  C++ |  Oracle |  Java | Unix |  Operating Systems |  Data Structure

Java Sample Questions ›› Java questions

Technical General Java Sample Questions

  1. Explain what is meant by the client / server model of network communication.

    Answer: In the client/server model, a server program runs on a computer somewhere on the Internet and "listens" for connection requests from client programs.The server makes some service available.A client program connects to the server to access that service.For example, a Web server has a collection of Web pages.A Web browser acts as a client for the Web server.It makes a connection to the server and sends a request for one of its pages.The server responds by transmitting a copy of the requested page back to the client.

  2. What is a socket?

    Answer: A socket represents one endpoint of a network connection.A program uses a socket to communicate with another program over the network.Data written by a program to the socket at one end of the connection is transmitted to the socket on the other end of the connection, where it can be read by the program at that end.

  3. What is a ServerSocket and how is it used?

    Answer: A SeverSocket is used by a server program to listen for connection requests from client programs.If listener refers to an object that belongs to Java's ServerSocket class, then calling the function listener.accept() will wait for a connection request and will return a Socket object that can be used to communicate with the client that made the request.

  4. Network server programs are often multithreaded.Explain what this means and why it is true?

    Answer: A multi-threaded server creates a new thread to handle each client connection that it accepts.A server program is generally designed to process connection requests from many clients.It runs in an infinite loop in which it accepts a connection request and processes it.If the processing takes a significant amount of time, it's not a good idea to make the other clients wait while the current client is processed.The solution is for the server to make a new thread to handle each client connection.The server can continue to accept other client connections even while the first client is being serviced.

  5. Explain what is meant by a recursive subroutine.

    Answer: A recursive subroutine is simply one that calls itself either directly or through a chain of calls involving other subroutines.

  6. What are the three operations on a stack?

    Answer: The three stack operations are push, pop, and isEmpty.The definitions of these operations are: push(item) adds the specified item to the top of the stack; pop() removes the top item of the stack and returns it; and isEmpty() is a boolean-valued function that returns true if there are no items on the stack.

  7. What is the basic difference between a stack and a queue?

    Answer: In a stack, items are added to the stack and removed from the stack on the same end (called the "top" of the stack).In a queue, items are added at one end (the "back") and removed at the other end (the "front").Because of this difference, a queue is a FIFO structure (items are removed in the same order in which they were added), and a stack is a LIFO structure (the item that is popped from a stack is the one that was added most recently).

  8. What is an activation record? What role does a stack of activation records play in a computer?

    Answer: When a subroutine is called, an activation record is created to hold the information that is needed for the execution of the subroutine, such as the values of the parameters and local variables.This activation record is stored on a stack of activation records.A stack is used since one subroutine can call another, which can then call a third, and so on.Because of this, many activation records can be in use at the same time.The data structure is a stack because an activation record has to continue to exist while all the subroutines that are called by the subroutine are executed.While they are being executed, the stack of activation records can grow and shrink as subroutines are called and return.

  9. What is a postorder traversal of a binary tree?

    Answer: In a traversal of a binary tree, all the nodes are processed in some way.(For example, they might be printed.) In a postorder traversal, the order of processing is defined by the rule: For each node, the nodes in the left subtree of that node are processed first.Then the nodes in the right subtree are processed.Finally, the node itself is processed.

  10. Explaining what is meant by parsing a computer program.

    Answer: To parse a computer program means to determine its syntactic structure, that is, to figure out how it can be constructed using the rules of a grammar (such as a BNF grammar).

« Previous || Next »

Java Sample Question Number: 1-10| 11-20| 21-30| 31-40| 41-50| 51-60| 61-70| 71-80| 81-90| 91-100| 101-110| 111-120| 121-130| 131-140| 141-150| 151-160| 161-170| 171-180| 181-190| 191-200| 201-210| 211-220| 221-230| 231-240| 241-250| 251-260| 261-270| 271-280| 281-290| 291-300| 301-310| 311-320| 321-330
Sample Test Questions
GRE Sample Questions
CAT Sample Questions
GMAT Sample Questions
TOEFL Sample Questions
ACT Sample Questions
SAT Sample Questions
LSAT Sample Questions
PSAT Sample Questions
MCAT Sample Questions
PMP Sample Questions
GED Sample Questions
ECDL Sample Questions
DMV Sample Questions
CCNA Sample Questions
MCSE Sample Questions
Network+ Sample Questions
A+ Sample Questions
Technical Sample Questions
WASL Sample Questions
CISA Sample Questions

Other Sample Questions
Sample Interview Questions
Sample Teacher Interview Questions
Sample Citizenship Questions
Accuplacer Sample Questions
Science Bowl sample Questions
Driving Test Sample Questions
Sample Survey Questions Sample Essay Questions
Sample Behavioral Interview Questions

Copyright © 2004-2013, Best BSQ. All Rights Reserved.