Font size
WorksheetsJAVA Intern
Total questions: 65
Worksheet time: 1hrs 5mins
What is default scope of bean in Spring framework?
singleton
prototype
request
session
Which is the way to provide configuration metadata to spring?
XML Based configuration file.
Annotation based configuration.
Java based configuration.
All of the above.
What types of Dependency injection does spring supports?
Constructor based, Setter based
Constructor based, Setter based, Getter Based
Setter based, Getter based, Properties based
Constructor based, Setter based, Properties based
What is Dependency Injection?
It is a design pattern which implements Inversion of Control for software applications.
It is one of the spring module.
It is a technique to get dependencies of any project.
It is used to promote tight coupling in code.
How to get object of a service in spring framework?
Using new keyword
Using dependency injection
Which class acts as IoC Container?
ServletContext
DispatcherServlet
ApplicationContext
None of the above
Can we integrate Struts with Spring.
yes
No
What are the types of the transaction management Spring supports
Programmatic transaction management
Declarative transaction management
Both of above
None of above.
If a bean is created once per Ioc Container, scope is
singleton
global-session
prototype
request
What is a DispatcherServlet?
DispatcherServlet is used for transaction management.
DispatcherServlet is used for AOP.
DispatcherServlet handles all the HTTP requests and responses.
DispatcherServlet is used for Dependency injection.
Where do you define DispatcherServlet?
In Beans configuration file.
Web.xml file
Meta-inf/dispatcher.xml
Web-inf/ dispatcher.xml
Purpose of J2EE is_____
to provide a platform for developing and running enterprise applications
to enhance desktop application and Enterprise performance
to provide a platform for running only enterprise applications
______ is used to find and fix bugs in Java programs
JDM
JDB
What does JDK stand for in Java programming?
Java Development Kit
Java Data Kit
Java Deployment Kit
Java Design Kit
What are the key differences between List and Set in the Java Collection Framework?
List Maintains order
List allows duplicates and Set does not allow duplicates
Which method is used to check if a specific element exists in a collection?
has()
find()
exists()
contains()
The retainAll() method of Java Collection Interface keeps only those elements in this queue that are present in the specified collection.
TRUE
FALSE
The addAll(Collection c) method adds all elements of the specified collection to the current collection from index 1.
In the J2EE architecture, which tier is responsible for handling the business logic?
Middle Tier
EIS tier
The client request is processed by the (a)
S______C______ object is used to store data that is accessible to all servlets in a web application?
(a)
Which of the following best describes the init() method in a servlet?
It is called once for each request.
It is called when the servlet is first loaded
It is called every time a servlet is destroyed.
It is called to handle client requests
(a) Method in HTTP partially updates a resource on the server
What does the <%-- --%> syntax represent in JSP?
An HTML comment.
A JSP comment.
A Java code block.
Which of the following are valid elements in a JSP page? (Select all that apply)
Directives
Scriptlets
Expressions
Declarations
What concepts are depicted in the image?
JSP Elements
JSP LifeCycle
JSP Compilation
Servlet Lifecycle
What is the primary purpose of the Java Virtual Machine (JVM)?
To compile Java code
To execute Java bytecode
To manage memory
To provide a user interface
(a) Method is used to send data to a server to create or update a resource
Which of the following are the most appropriate features of Servlet?
Platform Independence
Portable
Efficient and scalable
Containerless Sever
Which are valid declarations? (Choose all that apply.)
int $x
int 123
int _123
int #dim
int central_sales_region_Summer_2005_gross_sales
Which are legal declarations? (Choose all that apply.)
short x []
short [] y
short[5] x2
short z2 [5]
___________ methods does not contain any body
abstract
final
static
none
_________________ methods cannot be over ridden
abstract
final
constant
None
What is the environment variable which we should set for locating executable files (.exe,.com)
JAVA_HOME
classpath
path
none
What is the environment variable which we should set for locating classes, jars
JAVA_HOME
classpath
path
none
Set, List, and Map extend the java.util.Collection interface
True
False
Which of the following will not throw a NullPointerException? String s = null
if ((s!=null) & (s.length() > 0))
if ((s!=null) && (s.length() > 0))
if ((s==null) | (s.length() == 0))
a) if ((s==null) || (s.length() == 0))
What are valid keywords
Null
True
Implements
interface
instanceof
What is the access modifier for a class member variable which is to be used in the same package where the class is defined?
Protected
Private
Public
No Access Modifier
Static
What is the body of a Thread
Run
Begin
Execute
Start
Resume
If a class member variable is initialized and the value is not be changed at all, what is the modifier to be used during the declaration of the variable
const
fixed
public
Static
Final
Connection interface is implemented by
the database
the database driver
the programmer of the jdbc application
None
A thin driver is
Type 1 Driver
Type 2 Driver
Type 3 Driver
Type 4 Driver
What does executeUpdate() method of PreparedStatement interface returns
An object of ResultSet interface
an Object of PreparedStatement
an int value
a String Object
Java was originally named
Oak
C++-++
Advanced C++
Coffee
Java is a (a) language
Choose the correct order of the Java program execution.
A. Class Loader
B. Interpretation
C. Compilation
D. Byte Code Verification
E. Java Source Code
F. Execution
E-C-A-D-B-F
A-C-B-D-F-E
E-C-B-A-D-F
E-B-C-A-D-F
Which of the following is used to load a .class file?
Class Loader
JIT compiler
Byte Code verifier
Interpreter
JVM stands for (a)
How many class files will be created for the following code?
class A { .... }
class B { .... }
public class C
{
public static void main(String args[])
{
...... } }
Note: Assume that A,B and C are in same file TestClass.java
1
2
3
0
Java is a pure object oriented programming language.
Yes
No
The keyword "method" is an another name for?
function
variable
class
object
Where does a java program starts its execution?
class
main
method
object
What will be the Output o the following code?
class Sample{
public static void main(String args[])
{
int len = args.length;
System.out.println(len);
}
}
Compilation Error
Runtime Error
The program compiles and executes successfully but prints nothing
The program compiles and executes successfully and prints 0
If we want to print "I am new to Java" in java, we have to write (a)
What is an instance of a class?
Class
Object
Reference
Primitive
Autoboxing converts primitive to corresponding object wrapper class
true
false
What is the default value of a primitive int data type?
-1
null
0
garbage data
Consider the given code. What would be the display on the screen?
Class A
Class B
Class C
Compile error
Composition is a
uses-a relationship
has-a relationship
is-a relationship
none of the above
Enter Your Name
Enter Your Enrolment No
Enter Your Branch(CSE, CSE-DS, CSE-AIML, CSIT, CY, IT)
Enter Your Acropolis Email ID
Enter Your Batch(2026 or 2027)
