Interview Questions

Top 50 J2EE Interview Questions and Answers

Interview Questions December 28, 2018
J2EE Interview Questions and Answer

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.

Q1) Autocloseable was introduced in ?

a) java SE 7
b) java SE 8
c) java SE 6
d) java SE 4

Answer: a) java SE 7

Q2) An alternative way of using finally to close resource is by

a) catch block
b) autocloseable interface to be implemented
c) try block
d) throw Exception

Answer: b) autocloseable interface to be implemented

Q3) Flushable interface was introduced in ?

a) java SE 7
b) java SE 8
c) java SE 6
d) java SE 5

Answer: d) java SE 5

Q4) ________ is not a maven goal.

a) clean
b) package
c) install
d) debug

Answer: d) debug

Q5) _________ is used to specify the packaging cycle.

a) build.x
b) pom.xml
c) dependency.xml
d) version.xml

Answer: a) build.xml

Q6) __________ is used to specify the path to maven.

a) JAVA_HOME
b) PATH
c) MAVEN_HOME
d) CLASSPATH

Answer: c) MAVEN_HOME

Q7) Which one of the following annotations is not used in Hibernate?

a) @Entity
b) @Column
c) @Basic
d) @Query

Answer: d) @Query

Q8) Java introduced annotation in ?

a) Java 5
b) Java 6
c) Java 7
d) Java 8

Answer: a) Java 5

Q9) Which one of the following is not an annotation used by Junit with Junit4?

a) @Test
b) @BeforeClass
c) @AfterClass
d) @Ignored

Answer: d) @Ignored

Q10) _________ is the Parent class of annotation class?

a) Class
b) Object
c) Main
d) Super

Answer: b) Object

Q11) The remaining capacity of BlockingQueue whose intrinsic capacity is not defined is _________

a) Integer.MAX_VALUE
b) BigDecimal.MAX_VALUE
c) 99999999
d) Integer.INFINITY

Answer: a) Integer.MAX_VALUE

Q12) What is the difference between Queue and Stack?

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;

Q13) To simulate if then behavior in Junits we use.......?

a) if[..] else[..]
b) if(..)[..] else[..]
c) Mockito.when(…).thenReturn(…);
d) Mockito.if(..).then(..);

Answer: c) Mockito.when(…).thenReturn(…);

Q14) What is used to inject mock fields into the tested object automatically?

a) @InjectMocks
b) @Inject
c) @InjectMockObject
d) @Mock

Answer: a) @InjectMocks

Q15) Which object stores references to the request and response objects?

a) sessionContext
b) pageContext
c) HttpSession
d) sessionAttribute

Answer: b) pageContext

Q16) Which tag is used to set a value of a JavaBean?

a) <c:set>
b) <c:param>
c) <c:choose>
d) <c:forward>

Answer: a) <c:set>

Q17) Which of the following is not a directive in JSP?

a) page directive
b) include directive
c) taglib directive
d) command directive

Answer: d) command directive

Q18) Which of the following is not an inheritance mapping strategies?

a) Table per hierarchy
b) Table per concrete class
c) Table per subclass
d) Table per class

Answer: d) Table per class

Q19) n which file database table configuration is stored?

a) .dbm
b) .hbm
c) .ora
d) .sql

Answer: b) .hbm

Q20) Which of the following method is used inside session only?

a) merge()
b) update()
c) end()
d) kill()

Answer: b) update()

Q21) Which of the following code is used to get an attribute in a HTTP Session object in servlets?

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)

Q22) Which of the following is true about servlets?

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

Q23) How constructor can be used for a servlet?

a) Initialization
b) Constructor function
c) Initialization and Constructor function
d) Setup() method

Answer: c) Initialization and Constructor function

Q24) Which design pattern ensures that only one object of particular class gets created?

a) Singleton pattern
b) Filter pattern
c) State pattern
d) Bridge pattern

Answer: a) Singleton pattern

Q25) What does MVC pattern stands for?

a) Mock View Control
b) Model view Controller
c) Mock View Class
d) Model View Class

Answer: b) Model view Controller

Q26) Which design pattern represents a way to access all the objects in a collection?

a) Iterator pattern
b) Facade pattern
c) Builder pattern
d) Bridge pattern

Answer: a) Iterator pattern

Q27) Which of the following is not a feature of Beans?

a) Introspection
b) Events
c) Persistence
d) Serialization

Answer: d) Serialization

Q28) How to specify autowiring by name?

a) @Qualifier
b) @Type
c) @Constructor
d) @Name

Answer: a) @Qualifier

Q29) Which of the following is correct error when loading JAR file with duplicate name?

a) java.io.NullPointerException
b) java.lang.ClassNotFound
c) java.lang.ClassFormatError
d) java.lang.DuplicateClassError

Answer: c) java.lang.ClassFormatError

Q30) Which of these is an correct way making a list that is upper bounded by class Number?

a) List<? extends Number>
b) List<extends ? Number>
c) List(? extends Number)
d) List(? UpperBounds Number)

a) List<? extends Number>

Q31) Which of these is wildcard symbol?

a) ?
b) !
c) %
d) &

Answer: a) ?

Q32) What are the two types of Streams offered by java 8?

a) sequential and parallel
b) sequential and random
c) parallel and random
d) random and synchronized

Answer: a) sequential and parallel

33) What is Optional object used ?

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

Q34) What is the substitute of Rhino javascript engine in Java 8?

a) Nashorn
b) V8
c) Inscript
d) Narcissus

Answer: a) Nashorn

Q35) Which feature of java 8 enables us to create a work stealing thread pool using all available processors
at its target?

a) workPool
b) newWorkStealingPool
c) threadPool
d) workThreadPool

Answer: b) newWorkStealingPool

Q36) Which of these class allows us to define our own formatting pattern for dates and time?

a) DefinedDateFormat
b) SimpleDateFormat
c) ComplexDateFormat
d) UsersDateFormat

Answer: b) SimpleDateFormat

Q37) Which of these data type cannot be type parameterized?

a) Array
b) List
c) Map
d) Set

Answer: a) Array

Q38) What is synchronization in reference to a thread?

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.

Q39) Which component is responsible to optimize bytecode to machine code?

a) JVM
b) JDK
c) JIT
d) JRE

Answer: c) JIT

Q40) What is use of interpreter?

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

Q41) Which of these is a method of class Date which is used to search whether object contains a date before the specified date?

a) after()
b) contains()
c) before()
d) compareTo()

Answer: c) before()

Q42) Which of these methods calls update() method?

a) notify()
b) observeObject()
c) updateObserver()
d) notifyObserver()

Answer: d) notifyObserver()

Q43) Which of these package provides the ability to read and write in Zip format?

a) java.lang
b) java.io
c) java.util.zip
d) java.util.zar

Answer: c) java.util.zip

Q44) Observable class is used _______?

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

Q45) What is the name of a data member of class Vector which is used to store a number of elements in the vector?
a) length

b) elements
c) elementCount
d) capacity

Answer: c) elementCount

Q46) Which of these are integer constants of TextEvent class?

a) TEXT_CHANGED
b) TEXT_FORMAT_CHANGED
c) TEXT_VALUE_CHANGED
d) TEXT_sIZE_CHANGED

Answer: c) TEXT_VALUE_CHANGED

Q47) Which of these is superclass of WindowEvent class?a) WindowEvent

b) ComponentEvent
c) ItemEvent
d) InputEvent

Answer: b) ComponentEvent

Q48) Which of these events is generated by scroll bar?

a) ActionEvent
b) KeyEvent
c) WindowEvent
d) AdjustmentEvent

Answer: d) AdjustmentEvent

Q49) Which of these Exceptions is thrown by loadClass() method of ClassLoader class?

a) IOException
b) SystemException
c) ClassFormatError
d) ClassNotFoundException

Answer: d) ClassNotFoundException

Q50) Which of these methods can be used to determine the type of event?

a) getID()
b) getSource()
c) getEvent()
d) getEventObject()

Answer: a) getID()

Besant Technologies – Chennai & Bangalore Branch Locations

Besant Technologies - Velachery Branch

Plot No. 119, No.8, 11th Main road, Vijaya nagar,

Velachery, Chennai - 600 042

Tamil Nadu, India

Landmark - Reliance Digital Opposite Street

  +91-8099 770 770

  info@besanttechnologies.com

Besant Technologies - Tambaram Branch

No.2A, 1st Floor, Duraisami Reddy Street,

West Tambaram, Chennai - 600 045

Tamil Nadu, India

Landmark - Near By Passport Seva

  +91-8099 770 770

  info@besanttechnologies.com

Besant Technologies - OMR Branch

No. 5/318, 2nd Floor, Sri Sowdeswari Nagar,

OMR, Okkiyam Thoraipakkam, Chennai - 600 097

Tamil Nadu, India

Landmark - Behind Okkiyampet Bus Stop,

  +91-8099 770 770

  info@besanttechnologies.com

Besant Technologies - Porur Branch

No. 180/84, 1st Floor, Karnataka Bank Building,

Trunk Road, Porur, Chennai - 600 116

Tamil Nadu, India

Landmark - Opposite to Gopalakrishna Theatre

  +91-8099 770 770

  info@besanttechnologies.com

Besant Technologies - Anna Nagar Branch

Plot No:1371, 28th street kambar colony,

I Block, Anna Nagar, Chennai - 600 040

Tamil Nadu, India

Landmark - Behind Reliance Fresh

  +91-8099 770 770

  info@besanttechnologies.com

Besant Technologies - T.Nagar Branch

Old No:146/2- New No: 48,

Habibullah Road,T.Nagar, Chennai - 600 017

Tamil Nadu, India

Landmark - Opposite to SGS Sabha

  +91-8099 770 770

  info@besanttechnologies.com

Besant Technologies - Thiruvanmiyur Branch

22/67, 1st Floor, North mada street, Kamaraj Nagar

Thiruvanmiyur, Chennai 600041

Tamil Nadu, India

Landmark - Above Thiruvanmiyur ICICI Bank

  +91-8099 770 770

  info@besanttechnologies.com

Besant Technologies - Siruseri Branch

No. 4/76, Ambedkar Street, OMR Road, Egatoor, Navallur,

Siruseri, Chennai 600130

Tamil Nadu, India

Landmark - Near Navallur Toll Gate, Next to Yamaha Showroom

  +91-8099 770 770

  info@besanttechnologies.com

Besant Technologies - Maraimalai Nagar Branch

No.37, Ground Floor, Thiruvalluvar Salai,

Maraimalai Nagar,Chennai 603209

Tamil Nadu, India

Landmark - Near to Maraimalai Nagar Arch

  +91-8099 770 770

  info@besanttechnologies.com

Besant Technologies - BTM Layout Branch

No 2, Ground floor, 29th Main Road,

Kuvempu Nagar,BTM Layout 2nd Coming from Silkboard,

AXA company signal, Stage, Bangalore - 560 076

Karnataka, India

Landmark - Next to OI Play School

  +91-8767 260 270

  info@besanttechnologies.com

Besant Technologies - Marathahalli Branch

No. 43/2, 2nd Floor, VMR Arcade,

Varthur Main Road, Silver Springs Layout,

Munnekollal, Marathahalli, Bengaluru - 560037

Karnataka, India

Landmark - Near Kundalahalli Gate Signal

  +91-8767 260 270

  info@besanttechnologies.com

Besant Technologies - Rajaji Nagar Branch

No. 309/43, JRS Ecstasy, First Floor,

59th Cross, 3rd Block, Bashyam Circle,

Rajaji Nagar, Bangalore - 560 010

Karnataka, India

Landmark - Near Bashyam Circle

  +91-8767 260 270

  info@besanttechnologies.com

Besant Technologies - Jaya Nagar Branch

No. 2nd Floor,1575,11th Main Road,

4th T-Block, Pattabhirama Nagar,

Jaya Nagar, Bangalore - 560 041

Karnataka, India

Landmark - Opposite to Shanthi Nursing Home

  +91-8767 260 270

  info@besanttechnologies.com

Besant Technologies - Kalyan Nagar Branch

No.513, 4th Cross Rd

2nd Block, HRBR Layout,

Kalyan Nagar, Bangalore - 560 043

Karnataka, India

Landmark - Opposite to kalayan nagar Axis Bank

  +91-8767 260 270

  info@besanttechnologies.com

Besant Technologies - Electronic City Branch

No. 7, 3rd Floor, Ganga Enclave,

Neeladri Road, Karuna Nagar, Doddathoguru Village,

Electronics City Phase 1, Electronic City,

Bangalore - 560100, karnataka, India

Landmark - Adjacent to HDFC Bank and State Bank Of India

  +91-8767 260 270

  info@besanttechnologies.com

Besant Technologies - Indira Nagar Branch

No.54, 1st Floor,

5th Main kodihalli,

Bengaluru, Karnataka 560008, India

Landmark - Behind Leela Palace Hotel,

  +91-8767 260 270

  info@besanttechnologies.com

Besant Technologies - HSR Layout Branch

Plot No. 2799 & 2800, 27th Main,

1st Sector, HSR Layout,

Bengaluru, Karnataka 560102, India

  +91-8767 260 270

  info@besanttechnologies.com

Besant Technologies - Hebbal Branch

No.29, 2nd Floor, SN Complex,

14th Main Road, E-Block Extention, Sahakara Nagar,

Bengaluru, Karnataka -560092, India

  +91-8767 260 270

  info@besanttechnologies.com

Scroll Up