Top J2EE Interview Questions and Answers
J2EE Interview Questions and answers
J2EE Interview Questions and answers for beginners and experts. List of frequently asked J2EE Interview Questions with answers by Besant Technologies. We hope these J2EE Interview Questions and answers are useful and will help you to get the best job in the networking industry. This J2EE Interview Questions and answers are prepared by J2EE Professionals based on MNC Companies expectation. Stay tuned we will update New J2EE Interview questions with Answers Frequently. If you want to learn Practical J2EE Training then please go through this J2EETraining in Chennai .
Best J2EE Interview Questions and answers
Besant Technologies supports the students by providing J2EE Interview Questions and answers for the job placements and job purposes. J2EE is the leading important course in the present situation because more job openings and the high salary pay for this J2EE and more related jobs. We provide the J2EEonline training also for all students around the world through the Gangboard medium. These are top J2EE Interview Questions and answers, prepared by our institute experienced trainers.
J2EE Interview Questions and answers for the job placements
Here is the list of most frequently asked J2EE Interview Questions and answers in technical interviews. These questions and answers are suitable for both freshers and experienced professionals at any level. The questions are for intermediate to somewhat advanced J2EE professionals, but even if you are just a beginner or fresher you should be able to understand the answers and explanations here we give.
a) java SE 7
b) java SE 8
c) java SE 6
d) java SE 4
Answer: a) java SE 7
a) catch block
b) autocloseable interface to be implemented
c) try block
d) throw Exception
Answer: b) autocloseable interface to be implemented
a) java SE 7
b) java SE 8
c) java SE 6
d) java SE 5
Answer: d) java SE 5
a) clean
b) package
c) install
d) debug
Answer: d) debug
a) build.x
b) pom.xml
c) dependency.xml
d) version.xml
Answer: a) build.xml
a) JAVA_HOME
b) PATH
c) MAVEN_HOME
d) CLASSPATH
Answer: c) MAVEN_HOME
a) @Entity
b) @Column
c) @Basic
d) @Query
Answer: d) @Query
a) Java 5
b) Java 6
c) Java 7
d) Java 8
Answer: a) Java 5
a) @Test
b) @BeforeClass
c) @AfterClass
d) @Ignored
Answer: d) @Ignored
a) Class
b) Object
c) Main
d) Super
Answer: b) Object
a) Integer.MAX_VALUE
b) BigDecimal.MAX_VALUE
c) 99999999
d) Integer.INFINITY
Answer: a) Integer.MAX_VALUE
a) Queue is FIFO; Stack is LIFO;
b); Stack is FIFO; Queue is LIFO
c) Stack and Queue is FIFO
d) Queue and Stack is LIFO
Answer: a) Queue is FIFO; Stack is LIFO;
a) if[..] else[..]
b) if(..)[..] else[..]
c) Mockito.when(…).thenReturn(…);
d) Mockito.if(..).then(..);
Answer: c) Mockito.when(…).thenReturn(…);
a) @InjectMocks
b) @Inject
c) @InjectMockObject
d) @Mock
Answer: a) @InjectMocks
a) sessionContext
b) pageContext
c) HttpSession
d) sessionAttribute
Answer: b) pageContext
a) <c:set>
b) <c:param>
c) <c:choose>
d) <c:forward>
Answer: a) <c:set>
a) page directive
b) include directive
c) taglib directive
d) command directive
Answer: d) command directive
a) Table per hierarchy
b) Table per concrete class
c) Table per subclass
d) Table per class
Answer: d) Table per class
a) .dbm
b) .hbm
c) .ora
d) .sql
Answer: b) .hbm
a) merge()
b) update()
c) end()
d) kill()
Answer: b) update()
a) session.getAttribute(String name)
b) session.alterAttribute(String name)
c) session.updateAttribute(String name)
d) session.setAttribute(String name)
Answer: a) session.getAttribute(String name)
a) Servlets execute within the address space of web server
b) Servlets are X-platform because they are written in java
c) Servlets can utilize full functionality of the Java class libraries
d) Servlets execute within the address space of web server, It is cross-platform and utilize all functionality of java class libraries
Answer: d) Servlets execute within the address space of web server, It is cross-platform and utilize all functionality of java class libraries
a) Initialization
b) Constructor function
c) Initialization and Constructor function
d) Setup() method
Answer: c) Initialization and Constructor function
a) Singleton pattern
b) Filter pattern
c) State pattern
d) Bridge pattern
Answer: a) Singleton pattern
a) Mock View Control
b) Model view Controller
c) Mock View Class
d) Model View Class
Answer: b) Model view Controller
a) Iterator pattern
b) Facade pattern
c) Builder pattern
d) Bridge pattern
Answer: a) Iterator pattern
a) Introspection
b) Events
c) Persistence
d) Serialization
Answer: d) Serialization
a) @Qualifier
b) @Type
c) @Constructor
d) @Name
Answer: a) @Qualifier
a) java.io.NullPointerException
b) java.lang.ClassNotFound
c) java.lang.ClassFormatError
d) java.lang.DuplicateClassError
Answer: c) java.lang.ClassFormatError
a) List<? extends Number>
b) List<extends ? Number>
c) List(? extends Number)
d) List(? UpperBounds Number)
a) List<? extends Number>
a) ?
b) !
c) %
d) &
Answer: a) ?
a) sequential and parallel
b) sequential and random
c) parallel and random
d) random and synchronized
Answer: a) sequential and parallel
a) for optional runtime argument
b) for optional spring profile
c) to represent null with absent value
d) it’s not mandatory for method to return object
Answer: c) to represent null with absent value
a) Nashorn
b) V8
c) Inscript
d) Narcissus
Answer: a) Nashorn
at its target?
a) workPool
b) newWorkStealingPool
c) threadPool
d) workThreadPool
Answer: b) newWorkStealingPool
a) DefinedDateFormat
b) SimpleDateFormat
c) ComplexDateFormat
d) UsersDateFormat
Answer: b) SimpleDateFormat
a) Array
b) List
c) Map
d) Set
Answer: a) Array
a) the process of handling shared resource between two or more threads.
b) It’s a process by which many thread are able to provide simultaneous access same shared resource
c) It’s a process by which a method is able to provide simultaneous access many different threads
d) It’s a method that allow too many threads to access any kind of information it needs.
Answer: a) the process of handling shared resource between two or more threads.
a) JVM
b) JDK
c) JIT
d) JRE
Answer: c) JIT
a) They convert bytecode to machine language code
b) They read high level code line by line and execute them simultaniously
c) They are intermediated between JIT and JVM
d) It is a synonym for JIT
Answer: b) They read high level code line by line and execute them simultaniously
a) after()
b) contains()
c) before()
d) compareTo()
Answer: c) before()
a) notify()
b) observeObject()
c) updateObserver()
d) notifyObserver()
Answer: d) notifyObserver()
a) java.lang
b) java.io
c) java.util.zip
d) java.util.zar
Answer: c) java.util.zip
a) to create global subclasses
b) to create classes that other part of the program can observe
c) to create classes that can be accessed by other parts of program
d) to create methods that can be accessed by other parts of program
Answer: b) to create classes that other part of the program can observe
a) length
b) elements
c) elementCount
d) capacity
Answer: c) elementCount
a) TEXT_CHANGED
b) TEXT_FORMAT_CHANGED
c) TEXT_VALUE_CHANGED
d) TEXT_sIZE_CHANGED
Answer: c) TEXT_VALUE_CHANGED
b) ComponentEvent
c) ItemEvent
d) InputEvent
Answer: b) ComponentEvent
a) ActionEvent
b) KeyEvent
c) WindowEvent
d) AdjustmentEvent
Answer: d) AdjustmentEvent
a) IOException
b) SystemException
c) ClassFormatError
d) ClassNotFoundException
Answer: d) ClassNotFoundException
a) getID()
b) getSource()
c) getEvent()
d) getEventObject()
Answer: a) getID()
JDBC driver is software that is used to connect applications using the database.
We have four JDBC drivers
- Jdbc-odbc bridge driver 2.network protocol driver 3. Native api driver .4 thin driver.
Yes, I know. we have connection, statement, prepared statement, resultset, callable statement..etc JDBC APIs are there.
By using the execute method we can execute update and selection SQL operations and this returns Boolean
By using the executeQuery method we can execute the select SQL operation only and it returns the result set object.
Using the callable statement of prepare all method we can execute stored procedures in JDBC.
Using blob and clob data types we can store binary data and character data in the database using JDBC.
Yes, I know how to connect the database using JDBC. The following are the steps to connect the database using JDBC,
- First, we need to load the driver class based on the database you want to use.
- Create the connection using the connection interface
- Create the statement using the statement interface
- Execute the queries whichever you want like select, update, create..etc
- Finally, close the connection
We have three result set types, 1. ResultSet.type_forward_only 2. ResultSet.type_scroll_incensitive 3. ResultSet.type_scroll_sensitive
Web.xml is called a deployment descriptor in servlets. Every deployment descriptor has a servlet configured with URL pattern for any request processing.
We have mainly 3 annotations in servlet.
- @WebServlet: Used for servlet class.
- @WebListener: Used for listener class.
- @WebFilter: Used for filter class.
1. Forward is used to sending the same request and sendRedirect sends a new request.
2. Forward request works for client-side and sendRedirect works for server-side.
RequestDispacher is an interface it is used to dispatch the requested resource like JSP, HTML, servlet.
The Servlet container creates ServletConfig for each servlet and the ServletContext object is created for each web application.
We have four session tracking techniques in servlets,
- By using cookies
- By using URL rewriting using HTTP session
- BY using hidden fields
Yes I know how implement servlets using http servlet and generic servlets.
No servlets are not synchronized. Tf you want to make synchronized we need to implement single thread interface in your class.
Mainly used HTTP methods are, Get, Post, Put, Delete.
War files indicate the web applications whereas ear files are enterprise applications. War files run web server application server and ear runs only enterprise server.
- We have two object types in JSP,
- Implicit objects (automatically created in JSP equivalent servlet program)
- Explicit objects (created by programmer manually)
There are three life cycles methods in jsp,
- JspInit()
- _jspService()
- jspDestroy()
Two ways we can handle errors/exceptions in JSP,
- By using errorPage and isErrorPage attributes of Page Directive
- By using <error-page> xml tag ini web.xml
In Jsp we have 9 implicit objects
- Request
- Page,
- The session
- Application,
- Out,
- Config
- Exception
- PageContext
- Response
- Scriptlet(<%——-%>)
- Expression(<%=——-%>)
- Declaration(<%!———%>
Some of the jsp action tags are,
- <Jsp:forward>
- <Jsp:include>
- <Jsp:useBean>
- <Jsp:setProperty>
- <Jsp:getProperty>
Two ways we can import the packages in JSP
- Using JSP directive tags 2. Using the Import statement
- We have four scopes in JSP, 1. Page,2. Request. 3. Session 4. Application.
- We have five JSTL tags 1. Core tags 2 SQL tags 3. XML tags 4. Functional tags 5.internalzation tags
- Using the page session attribute we can disable the session in jsp page.
- <%@ page session=”false” %>
- We have the following literals in JSP,
- Null, Boolean, String, Float, and integer
- Some of the Major Advantages of JSP over Pure Servlets
- It is easy convenient to write and modify HTML
- printin statements that generate the HTML.
- Writing Java code in HTML pages.
- Platform independence.
- Server-side programming.