NIITQ7

Màu nền
Font chữ
Font size
Chiều cao dòng

Identify the most reliable bidirectional and connection oriented protocol ?

1. UDP

2. HTTP

3. TCP/IP

4. SMTP

answer:3

A machine is identified by its IP address. Obtain the method that is used to encapsulate the IP address of a machine.

1. InetAddress.getName( );

2. InetAddress.getByName( );

3. InetAddress.Name( );

4. InetAddress.Host( );

answer:2

Which of the following statements is true with respect to servlets ?

1. Servlets execute on the client side of a Web connection.

2. Applets are also called as Servlets.

3. Servlets execute on the server side of a Web connection.

4. Servlets are a replacement for network programming in Java.

answer:3

How is a Java Bean defined ?

1. A software component that has been designed to be reusable in a variety of different environments.

2. A Software component that is used for remote method invocation.

3. A software component that communicates between two ORBs.

4. A software component which helps in multithreaded programming.

answer:1

RMI extensively uses remote interfaces. When you want to create a remote object, you mask the underlying implementation by passing around the interface. In this scenario how do you declare an interface ?

1. Protected

2. Private

3. Public

4. Package

answer:3

Which distributed object technology is most appropriate for systems that consist entirely of Java objects ?

1. RMI

2. CORBA

3. DCOM

4. DCE

Which one of the following is located in a Java security policy file ?

1. Aliases and their public keys

2. Trusted Code

3. Grant Entries

4. Digital Signatures.

answer:3

Among the following roles, which role is not performed by the Java architect ?

1. Evaluating the advantages and disadvantages of using Java technology for enterprise applications.

2. Designing distributed object architectures to a given set of business requirements.

3. Training users on how to operate a Java-based application.

4. Evaluating proposed Java technology architectures and making recommendations to increase performance and security.

answer:3

Which of the following is an advantage of a one-tier application ?

1. Security

2. Interoperability

3. Scalability

4. Manageability

answer:1

Name the object which controls the execution of every Java program.

1. Java Applets

2. JVM

3. Java Swings

4. Java Bytecode

answer:2

If an existing legacy database supports ODBC but not JDBC, which technology can be used to access the database from a Java applet ?

1. The Java-ODBC bridge driver.

2. ODBC-capable database middleware.

3. JNI

4. JNDI

answer:1

Identify the correct definition of JIT, which is a part of JVM.

1. JIT compiles bytecode into executable code in real time, on a piece by piece, on demand basis .

2. JIT implements security to JVM

3. JIT is not a part of JVM

4. JIT compiles Java code into bytecode.

answer:1

Which of the following statements is incorrect with respect to JVM ?

1. JVM will differ from platform to platform.

2. All JVM will interpret the bytecode.

3. The execution of every program is under the control of JVM

4. It is not necessary to implement JVM on every platform. From the following code how many objects are garbage collected? answer:4

String string1 = "Test"; String string2 = "Today"; string1 = null; string1 = string2;

1. 3

2. 2

3. 1

4. 0

answer:3

Which one of the following statements is true about garbage collection ?

1. The garbage collector does not run in low memory situations.

2. You can run the garbage collector when ever you want.

3. When garbage collector runs it releases the memory allocated by an object.

4. The garbage collector runs in low memory situations and when it runs, it releases the memory allocated by an object.

answer:4

Identify the correct definition of the term MIME ?

1. MIME is an Internet standard for communicating multimedia content e-mail systems.

2. MIME is a firewall between Intranet and Internet.

3. MIME is a standard package in Java.

4. MIME is used as a firewall for TCP/IP networks.

answer:1

Name the tool that is available from JavaSoft site, that enables you to create, configure, and connect to a set of Beans.

1. JDK

2. BSDK

3. BDK

4. Starter Bean Kit

answer:3

Which of the following security feature was introduced in Java 2?

1. The capability to sign JAR files.

2. The applet sandbox.

3. The capability to specify an applet security policy.

4. Support for X259 version certificates.

answer:3

How can you force garbage collection?

1. Garbage collection cannot be forced .

2. By Call System.gc().

3. By Call Runtime.gc().

4. Set all references to null.

answer:1

Identify the names of the classes which are involved in TCP/IP programming.

1. ServerSocket and InetAddress.

2. ServerSocket and Socket.

3. Socket and InetAddress.

4. Socket and DatagramPacket.

answer:2

How will you define an acceptable structure of an XML document ?

1. By using Elements

2. By using References

3. By using Attributes

4. By using DTD

answer:4

You need to create a mailbox in which you can store mail folders. In addition, you need to display the list of mails in a mailfolder. Which method is suitable to perform the specified tasks ?

1. connect()

2. getStore()

3. list()

4. search()

answer:2

You are a senior programmer at XYZ Inc., New York. You need to develop an application, which enables the employees of your organization to access the library management system existing on the centralized server. Using the application, the employees should be able to reserve the books they require. Which technology satisfies these requirements ?

1. COM

2. RMI

3. JavaMail

4. XML

answer:2

Which statement is true with respect to XML tags ?

1. You can overlap tags.

2. The names of tags are not case-sensitive.

3. You can include tabs, carriage returns, and whitespaces in the names of XML tags.

4. You can specify a blank space followed by a forward slash after the name of a tag when there is no value associated with the tag. Predict the output of the following code snippet:

Store mystore = session.getStore("imap");

mystore.connect (mailServer, username, password);

Folder myfolder = mystore.getDefaultFolder();

Folder myfolders[] = folder.list();

1. This code snippet will display the list of mails in a folder.

2. This code snippet will display the content of the mail.

3. This code snippet will display the list of folders.

4. This code snippet will display the list of recipients.

Predict the output of the following code snippet:

java.util.Properties mailProperties = System.getProperties();

mailProperties.put(?mail.store.protocol?, ?POP3?);

1. The server address is stored in the system properties.

2. The object of the Session class is created.

3. The store protocol is added to the system properties.

4. The object of the Message class is created. Which component of RMI calls the RMI Server ?

1. RMI Stub

2. RMI Transport Layer

3. RMI Remote Reference Layer

4. RMI Skeleton Which code line will you use to copy the contents of another stylesheet into a stylesheet ?

1. <xsl:include href= ?URI? />

2. <xsl:import href= ?URI? />

3. <xsl:reserve-space elements= ?Name1, Name2??/>

4. <xsl:key name= ?qname? match = ?pattern? use= ?expression? />

Which class defines the rebind() method?

1. UnicastRemoteObject

2. Remote

3. Naming

4. rmi Which component is used by CORBA to invoke remote methods?

1. COM

2. ORB

3. RPC

4. DCOM

Identify the class that enables you to control and load the classes for implementation of various mail protocols?

1. javax.mail.Session

2. javax.mail.Message

3. javax.mail.Folder

4. javax.mail.Store

Identify the program that creates the activator?

1. rmid

2. rmic

3. rmiregistry

4. javac

Identify the method used to retrieve the total number of messages in a folder?

1. getMessages()

2. getMessageCount()

3. getMessageNumber()

4. getFrom()

dentify the mail folder that is supported by POP3?

1. Sent Items

2. Outbox

3. Inbox

4. Deleted Items How can you attach a file to an e-mail message?

1. By using the setFileName() method

2. By using the setContent() method

3. By using the addBodyPart() method

4. By using the sendMessage() method

Consider a scenario in which you have to develop an application for invocation of remote methods using ORB. The application needs to be language independent and the objects are passed by value. Identify the technology that satisfies these requirements.

1. DCOM

2. CORBA

3. RMI

4. RPC

Correct Answer :-> 2

You need to create an application where a user is able to send e-mails with or without attachment(s). The application provides a GUI based java application that helps a user to specify the mail server address, username and password to connect to the mail server. The user can compose a message and send it to one or multiple recipients. Which package needs to be imported to create an application that satisfies the requirements ?

1. java.rmi.registry

2. javax.servlet

3. javax.mail.internet

4. javax.ejb

You need to create a user interface where a user can select a mail folder. Using the interface, the user should be able to specify various options to search the mails in the selected mail folder. Which class enables you to create such user interface ?

1. ConnectFrame

2. ShowMessageDialog

3. ViewMailFrame

4. SearchMailFrame Identify the package that defines SAX and DOM APIs ?

1. javax.xml.transform

2. javax.xml.parsers

3. org.w3c.dom

4. javax.xml.namespace

Identify the class that is used to store the search string representing the sender of the mail ?

1. FromStringTerm

2. SubjectTerm

3. SearchTerm

4. Store Identify the directives of JSP.

1. page, include, and taglib

2. include, autoFlush, and taglib

3. page, import, taglib, and buffer

4. contentType, include, and taglib

While developing an application in J2EE, you are repeatedly facing some problems. You notice that in this application there is no component to handle requests. In addition, there is no component that will separate the business logic from the presentation logic. Identify the design pattern that will enable you to solve these problems.

1. Composite View Pattern

2. Service to Worker Pattern

3. Data Access Object Pattern

4. Front Controller Pattern

Sally is working on a project related to the development of business in her organization. Her office consists of a centralized server containing all the data. Sally needs to access the relevant data from the server. For this, she needs to invoke the method defined in the centralized server. Which J2EE technology will enable her to access the data from the remote server ?

1. RMI

2. JMS

3. JDBC

4. EJB

You need to design an application to count the number of calls made in a day, from a particular phone. Each call lasts only for three minutes. You need to create a component that checks the call time. As soon as the call time exceeds three minutes, this component should get notified of the changed time. Which class will enable you to track the call time, by firing an event when the bound property changes ?

1. PropertyChangeSupport class

2. PropertyChangeEvent class

3. VetoableChangeSupport class

4. PropertyVetoException class

45. Identify the enterprise bean that is used to represent one row of persistent data stored in a database table.

1. Stateful Session Bean

2. Entity Bean

3. Message Driven Bean

4. Stateless Session Bean

46. You have created a ResultSet with the name ?rsEmp? to retrieve data from the Employees table. The Employees table contains the following fields:

EmpCode, EmpName, EmpDesignation and EmpSal

Which statement displays the value of EmpName column on the screen?

1. <%= rsEmp.getString(?EmpName?) %>

2. <%= rsEmp!getString(?EmpName?) %>

3. <% @= rsEmp.getString(?EmpName?) %>

4. <%= rsEmp.getParameter(?EmpName?) %>

Debbie needs to develop a Servlet that creates a login form in such a way that if a student logs on again, he need not enter the login information. Which is the method that will allow her to store the StudentID and Password, so that the student can log on without entering his information again?

1. getCookies()

2. setMaxAge()

3. getName()

4. getValue()

While creating a Java Bean using Introspection, you wish to enable the provision of additional information on each of bean?s parameters. Identify the sub classes of FeatureDescriptor class that you will use to allow additional information.

1. PropertyDescriptor

2. BeanDescriptor

3. ParameterDescriptor

4. EventSetDescriptor

To access a database using JDBC, you need to load a driver first. Identify the method that you will use for performing this step.

1. getConnection()

2. forName()

3. prepareStatement()

4. getString()

Identify the Status Code, which indicates that the request requires an HTTP authentication.

1. 200

2. 404

3. 400

4. 401

What can be defined as a collection of one or more objects from one or more classes?

1. Visual Components

2. Events

3. Component Elements

4. Properties Identify the error in the following code: ResultSet rs = MyStatement.executeQuery(?Select * From Student?);

While (rs1.next())

{

System.out.println(rs.getInt(?StudNo?)+? ?+rs.getString(?SName?)+? ?+rs.getString(?Class?));

}

1. The statement ?ResultSet rs? has an error.

2. The statement ?While (rs1.next())? has an error.

3. The ?executeQuery(?Select * From Student?)? has an error.

4. The statement ?System.out.println(rs.getInt(?StudNo?)+? ?+rs.getString(?SName?)+? ?+rs.getString(?Class?))? has an error.

To access a database using JDBC, you send a request to the Servlet and load a driver. After loading the driver, you need to create a connection. Identify the parameter that will be passed to the getConnection() method to create a connection.

1. sun.jdbc.odbc.JdbcOdbcDriver

2. invoked stored procedure

3. database URL

4. column index Which HTTP request method is used to store the resource identified by the request URL ?

1. GET

2. POST

3. PUT

4. HEAD

Identify the technology that binds names to components, and allows searching them by name.

1. JNDI

2. DNS

3. SAX

4. DOM

What is the purpose of Session Fa硤e pattern?

1. It provides a service layer to the clients exposing only those interfaces that are required for accessing the clients.

2. It helps in modifying the layout of the page.

3. It helps in reusing the code by making use of the same helper for other views that contain similar functionality.

4. It helps in managing the request authentication process, view management process and the error handling process on the server side. You need to create a servlet, which can access the contents of an Employees database. Identify the method of the ServletContext object, which will enable you to access the contents of this database.

1. log()

2. getMimeType()

3. getContext()

4. getResource()

You need to create a program in JSP that calculates the average marks of students in a class. For this, you need to access the Java Bean class to be used in your JSP. Which is the tag that you will use, which will enable you to locate and access this Java Bean class?

1. <jsp:include>

2. <jsp:aram>

3. <jsp:setProperty>

4. <jsp:useBean> Sam, who works as an accountant, needs to calculate the gross annual salaries of the employees in the Sales department. The data of all the employees is stored in a SQL database. Therefore, he needs to import the classes of the Java package ?java.sql.*? in a JSP page. Which is the statement that will enable him to import the java.sql package package ?

1. <%@ page include=?java.sql.* ? %>

2. <%@ page extends=?java.sql.* ? %>

3. <%@ page import=?java.sql.* ? %>

4. <%@ page uri=?java.sql.* ? %> While creating a Servlet, you need to include an object that will send the response to the client. Identify the methods of the ServletResponse interface that will enable you to define such an object.

1. SetContentType() and GetWriter()

2. getParameterNames() and getContentType()

3. service() and destroy()

4. GetServletContext() and GetInitParameter() You are developing electronic mail Beans. Identify the protocol which defines how an electronic mail message can be sent from one machine to another on the internet .

1. HTTP

2. SMTP

3. TCP/IP

4. FTP Which exception is thrown if a class does not implement the Serializable interface ?

1. java.beans.NotSerializableException

2. java.beans.ClassNotSerializableException

3. java.io.NotSerializableException

4. java.io.ClassNotSerializableException Which one of the following options describes JavaBeans ?

1. JavaBeans is the platform-dependent component architecture for Java.

2. JavaBeans is the single-use component architecture for Java.

3. JavaBeans is the software component architecture for Java.

4. JavaBeans is the hardware component architecture for Java. You have downloaded a set of Beans from the Web and installed them on your computer. Which mechanism does the builder tool use to provide information regarding the properties, events and methods provided by each of the Beans ?

1. Persistence

2. Serialization

3. Introspection

4. Validation Mary has written the following property in her JavaBean code:

public T[ ] getN( );

Identify the type of property used in the code.

1. Simple property

2. Boolean property

3. Indexed property

4. Array property

You are creating a JavaBean. You use a JAR file to efficiently deploy a set of classes and their associated resources. Which package contains the classes that read and write JAR files?

1. java.lang.zip

2. java.util.zip

3. java.beans.zip

4. java.net.zip

Jim wants to create an object of the ItemEvent class. Which one of the following options represents the constructor for the ItemEvent class ?

1. ItemEvent(ItemSelectable source, int id, Object item)

2. ItemEvent(ItemSelectable source, boolean id, Object item)

3. ItemEvent(ItemSelectable source, int id, Object item, int stateChange)

4. ItemEvent(ItemSelectable source, boolean id, Object item, int stateChange) Which one of the following methods is useful for event logging and debugging events in the ContainerEvent class?

1. public String paramString()

2. public Component getChild()

3. public Container getContainer()

4. public String toString()

69. Jack is using the following constructor in his JavaBean:

AWTEvent(Object obj, int id)

What does the parameter "id" indicate?

1. It identifies the number of events.

2. It is the object generating the source.

3. It identifies the type of event.

4. It is the object generating the event.

You have extracted all the files from an archive. The first element in the JAR file is its manifest file. What information is displayed in the first line of the manifest file?

1. The directory path information.

2. The version information.

3. The classpath information.

4. The algorithm information.

John is writing a Serializable class and needs to designate an alternative object. When writing an object to the stream he should implement a special method with the exact signature. Identify the method signature.

1. ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException;

2. ANY-ACCESS-MODIFIER Object Writereplace() throws ObjectStreamException;

3. ANY-ACCESS-MODIFIER object writeReplace() throws ObjectStreamException;

4. ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectstreamException; Identify the ability of a JavaBean to obtain information about the fields, constructors and methods of any class.

1. Reflection

2. Introspection

3. Serialization

4. Customization

Identify the command-line tool provided by JDK to calculate the SUID for the JavaBean class.

1. serialversion

2. serialver

3. serialidentity

4. serialid

dentify the process that enables you to save the state of several objects to a stream.

1. serialization

2. customization

3. reflection

4. introspection

Identify the method normally used by builder tools to recreate a Bean from a serialized Bean source.

1. finalize

2. instantiate

3. isInstanceOf

4. getInstanceOf

Which one of the following options describes the method signature:

public void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException?

1. Report a vetoable property update to any registered listeners.

2. Report a int vetoable property update to any registered listeners.

3. Report a boolean vetoable property update to any registered listeners.

4. Fire a vetoable property update to any registered listeners.

answer:1

7. Which one of the following options makes it possible to build applications that combine the functionality written in Java with the existing systems ?

1. A Bean that does not provide access to legacy code.

2. A Bean that provides access to legacy code.

3. A Bean that provides access to inner classes.

4. A Bean that does not provide access to inner classes.

answer:2

You are creating a JavaBean using the KeyEvent class. How many events are generated when an alphanumeric key is typed ?

1. One

2. Two

3. Three

4. Four

answer:3

Mike is using an array in his JavaBean code. What is the serialver syntax to get the serialVersionUID of an array of int elements ?

1. serialver "[Ijava.lang.Integer;"

2. serialver ["Ijava.lang.Integer";

3. serialver ["I";

4. serialver "[I;" answer:4

Identify the tool which allows you to configure and interconnect a set of Beans as well as change the properties and execute the Beans.

1. The Bean Deployment Kit

2. The Bean Development Kit

3. The Bean Deployer Kit

4. The Bean Developer Kit If you have a class called Inventory, identify the correct syntax for running RMI compiler.

1. rmic Inventory.rmi

2. rmi Inventory

3. rmic Inventory.java

4. rmic Inventory

answer:4

What information does the ServletRequest object contain ?

1. The request sent by a client

2. The request sent by a server

3. The request sent by a servlet

4. The request sent to a client

Robert needs to connect an application to a database using JDBC. Which one of the following steps should he follow ?

1. Load the JDBC driver, establish a database connection, execute an SQL statement, process the results, close the database connection.

2. Register a database connection, open JDBC driver, process the result, execute an SQL statement, close the connection.

3. Register the ODBC driver, establish a SQL statement, execute database connection, process the result, close the connection.

4. Establish a database connection, execute an SQL statement, process the results, close the driver. How are the shtml files processed in a server-side include?

1. By a server.

2. By any SSI Servlet.

3. By a special SSI Servlet.

4. By a client.

answer:3

What information is specified in the CODE attribute of the tag ?

1. A remote location from which the servlet is to be loaded.

2. The class name or registered name of the servlet to invoke.

3. The code for running the application.

4. The local drive location from which the servlet is to be loaded.

answer:2

Which class contains the method for returning the original Uniform Resource Locator (URL) used by the client to make a request?

1. HttpSession

2. HttpResponse

3. HttpServlet

4. HttpUtils

answer:4

Identify the class used to establish the connection from an applet to a servlet for text-based HTTP communication?

1. openConnection

2. URLConnection

3. servletConnection

4. ServletConnection

answer:2

Which package needs to be imported for writing a HTTP servlet?

1. HttpServletResponse

2. httpservlet

3. http

4. HttpServletRequest

answer:3

What alternative method does JSP support for inserting dynamic content ?

1. Using scriptlets.

2. Using HTML tags.

3. Using custom tags.

4. Using objects.

Identify the method that returns the names of all initialization parameters as an Enumeration of objects.

1. getInitParameter ()

2. getInitParameterNames ()

3. getInitparameter ()

4. getInitNames ()

answer:2

Identify the correct statement in relation to a Single Thread Model.

1. A single client can access the web application.

2. The doGet (), doPost (), and the service () methods for a servlet instance can be accessed by only a single thread at any given time.

3. The doGet (), doPost (), and the service () methods for a servlet instance can be accessed by multiple threads at any given time.

4. The servlet can only have one instance.

Identify the file that is not a component of JSDK 2.0.

1. JSDK.JAR file

2. README.txt file

3. src file

4. java file

answer:4

Identify the servlet engine that has the built-in capacity to handle servlets

1. Add-on

2. Embeddable

3. Standalone

4. Attachable

answer:3

Identify the process of verifying user's access privileges prior to entering a Web site's protected area ?

1. Confidentiality.

2. Integrity.

3. Authorization.

4. Authentication. Identify the API that enables a java program to process client requests.

1. JSDK

2. JDK

3. JDBC

4. RMI

answer:1

Why is serialization used in RMI ?

1. To pass objects between the stub and the client.

2. To pass objects between the stub and the remote interface.

3. To pass objects between the stub and the server.

4. To pass objects between the stub and the skeleton. Which one of the following options describes the comment attribute of a cookie ?

1. It is a string containing the value of the cookie.

2. It is a string containing the version/protocol of a cookie.

3. It is a string containing the description/purpose of a cookie.

4. It is a string containing the name of the cookie.

Identify the API that enables a java program to connect to a database.

1. The SQL API.

2. The BDK API.

3. The JDBC API.

4. The JSDK API.

Which interface should be implemented to serialize a Java object?

1. java.lang.Serializable

2. java.sql.Serializable

3. java.util.Serializable

4. java.io.Serializable

30.

The Character.Subset class instances in the Java language represent particular subsets of the Unicode character set. Which is the only family of subsets defined in the Character class?

1. Unicode

2. UnicodeBlock

3. UnicodeChar

4. UnicodeSet

answer:2

Bạn đang đọc truyện trên: Truyen2U.Pro