Top 150+ Solved Enterprise Computing With JAVA MCQ Questions Answer

From 16 to 30 of 173

Q. What is the range of the char type?

a. 0 to 216

b. 0 to 215

c. 0 to 216-1

d. 0 to 215-1

  • d. 0 to 215-1

Q. What are primitive data types?

a. byte, short, int, long

b. float, double

c. boolean

d. char

  • a. byte, short, int, long

Q. What are default values of different primitive types?

a. int - 0

b. short - 0

c. byte - 0

d. long - 0 l

  • a. int - 0

Q. How do we change the values of the elements of the array?

a. The array expression

b. The array subscript expression can be used to change the values of the elements of the array.

c. The definition of element

d. The definition & declaration of element array

  • b. The array subscript expression can be used to change the values of the elements of the array.

Q. Which of the following features are common to both Java & C++?

a. The class declaration

b. The access modifiers

c. The encapsulation of data & methods with in objects

d. All of above

  • d. All of above

Q. Which of the following statements accurately describe the use of access modifiers withina class definition?

a. They can be applied to both data & methods

b. They must precede a class's data variables or methods

c. They can appear in any order

d. All of above

  • d. All of above

Q. Which of the following statements can be used to describe a public method?

a. It is accessible to all other classes in the hierarchy

b. It represents the public interface of its class

c. All of above

d. None of these

  • c. All of above

Q. Which of the following statements correctly describes the relation between an object and the instance variable it stores?

a. Each new object has its own distinctive set of instance variables

b. Each object has a copy of the instance variables of its class

c. The instance variable of each object are separate from the variables of other objects

d. All of above

  • d. All of above

Q. What are the functions of the dot(.) operator?

a. It enables you to access instance variables of any objects within a class

b. It enables you to store values in instance variables of an object

c. It is used to call object methods

d. All of above

  • d. All of above

Q. When may a constructor be called without specifying arguments?

a. When the default constructor is not called

b. When the name of the constructor differs from that of the class

c. When there are no constructors for the class

d. None of above

  • c. When there are no constructors for the class

Q. When might your program wish to run the garbage collecter?

a. Before it enters a compute-intense section of code

b. Before it enters a memory-intense section of code

c. When it knows there will be some idle time

d. All of above

  • d. All of above

Q. Which method is used to specify before any lines that uses the PrintWriter?

a. setPageType()

b. setContextType()

c. setContentType()

d. setResponseType()

  • c. setContentType()

Q. Servlet mapping defines

a. an association between a URL pattern and a servlet

b. an association between a URL pattern and a request page

c. an association between a URL pattern and a response page

d. All of the above

  • a. an association between a URL pattern and a servlet

Q. The getSession() method with ‘true’ as its parameter [ getSession(true)] it will return the appropriate session object when

a. the session is completed

b. the session object is passed to another method

c. the session does not exists

d. the session is existing

  • d. the session is existing

Q. Dynamic interception of requests and responses to transform the information is done by

a. servlet container

b. servlet config

c. servlet context

d. servlet filter

  • d. servlet filter
Subscribe Now

Get All Updates & News