Job Interview Questions For Java Programmers #2

1) Can we define private and protected modifiers for variables in interfaces? (Core Java)

No.

2) What is the query used to display all tables names in SQL Server (Query analyzer)? (JDBC)

select * from information_schema.tables

3) What is Externalizable? (Core Java)

Externalizable is an Interface that extends Serializable Interface. And sends data into Streams in Compressed Format. It has two methods, writeExternal(ObjectOuput out) and readExternal(ObjectInput in)

4) What modifiers are allowed for methods in an Interface? (Core Java)

Only public and abstract modifiers are allowed for methods in interfaces.

5) What is a local, member and a class variable? (Core Java)

Variables declared within a method are "local" variables. Variables declared within the class i.e not within any methods are "member" variables (global variables). Variables declared within the class i.e not within any methods and are defined as "static" are class variables.

6) How many types of JDBC Drivers are present and what are they? (JDBC)

There are 4 types of JDBC Drivers

Type 1: JDBC-ODBC Bridge Driver
Type 2: Native API Partly Java Driver
Type 3: Network protocol Driver
Type 4: JDBC Net pure Java Driver

7) Can we implement an interface in a JSP? (JSP)

No

8) What is the difference between ServletContext and PageContext? (JSP)

ServletContext: Gives the information about the container PageContext: Gives the information about the Request 

9) What is the difference in using request.getRequestDispatcher() and context.getRequestDispatcher()? (JSP)

request.getRequestDispatcher(path): In order to create it we need to give the relative path of the resource context.getRequestDispatcher(path): In order to create it we need to give the absolute path of the resource.

10) How to pass information from JSP to included JSP? (JSP)

Using <%jsp:param> tag.

11) What is the difference between directives include and jsp include? (JSP)

<%@ include> : Used to include static resources during translation time. : Used to include dynamic content or static content during.

12) What are Predefined variables or implicit objects?

To simplify code in JSP expressions and scriptlets, we can use eight automatically defined variables, sometimes called implicit objects. They are request, response, out, session, application, config, pageContext, and page. 

13) What is BDK?

BDK, Bean Development Kit is a tool that enables to create, configure and connect a set of set of Beans and it can be used to test Beans without writing a code.

14) What is a Jar file?

Jar file allows to efficiently deploying a set of classes and their associated resources. The elements in a jar file are compressed, which makes downloading a Jar file much faster than separately downloading several uncompressed files. The package java. util. zip contains classes that read and write jar files. 

15) Explain the methods, rebind() and lookup() in Naming class?

rebind() of the Naming class(found in java. rmi) is used to update the RMI registry on the server machine. Naming. rebind(”AddSever”, AddServerImpl); lookup() of the Naming class accepts one argument, the rmi URL and returns a reference to an object of type AddServerImpl. 

16) What is UnicastRemoteObject?

All remote objects must extend UnicastRemoteObject, which provides functionality that is needed to make objects available from remote machines. 

17) What is RMI architecture?

RMI architecture consists of four layers and each layer performs specific functions:

a) Application layer - contains the actual object definition.
b) Proxy layer - consists of stub and skeleton.
c) Remote Reference layer - gets the stream of bytes from the transport layer and sends
it to the proxy layer.
d) Transportation layer - responsible for handling the actual machine-to-machine
communication.

Java Books
Java Certification, Programming, JavaBean and Object Oriented Reference Books

Return to : Java Programming Hints and Tips

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.
The site www.erpgreat.com is not affiliated with or endorsed by any company listed at this site.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.