wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JAVA Intern

Total questions: 65

Worksheet time: 1hrs 5mins

Name
Class
Date
1.

What is default scope of bean in Spring framework?

a)

singleton

b)

prototype

c)

request

d)

session

2.

Which is the way to provide configuration metadata to spring?

a)

XML Based configuration file.

b)

Annotation based configuration.

c)

Java based configuration.

d)

All of the above.

3.

What types of Dependency injection does spring supports?

a)

Constructor based, Setter based

b)

Constructor based, Setter based, Getter Based

c)

Setter based, Getter based, Properties based

d)

Constructor based, Setter based, Properties based

4.

What is Dependency Injection?

a)

It is a design pattern which implements Inversion of Control for software applications.

b)

It is one of the spring module.

c)

It is a technique to get dependencies of any project.

d)

It is used to promote tight coupling in code.

5.

How to get object of a service in spring framework?

a)

Using new keyword

b)

Using dependency injection

6.

Which class acts as IoC Container?

a)

ServletContext

b)

DispatcherServlet

c)

ApplicationContext

d)

None of the above

7.

Can we integrate Struts with Spring.

a)

yes

b)

No

8.

What are the types of the transaction management Spring supports

a)

Programmatic transaction management

b)

Declarative transaction management

c)

Both of above

d)

None of above.

9.

If a bean is created once per Ioc Container, scope is

a)

singleton

b)

global-session

c)

prototype

d)

request

10.

What is a DispatcherServlet?

a)

DispatcherServlet is used for transaction management.

b)

DispatcherServlet is used for AOP.

c)

DispatcherServlet handles all the HTTP requests and responses.

d)

DispatcherServlet is used for Dependency injection.

11.

Where do you define DispatcherServlet?

a)

In Beans configuration file.

b)

Web.xml file

c)

Meta-inf/dispatcher.xml

d)

Web-inf/ dispatcher.xml

12.

Purpose of J2EE is_____

a)

to provide a platform for developing and running enterprise applications

b)

to enhance desktop application and Enterprise performance

c)

to provide a platform for running only enterprise applications

d)
to create simple web pages
13.

______ is used to find and fix bugs in Java programs

a)
Compiler
b)

JDM

c)
JVM
d)

JDB

14.

What does JDK stand for in Java programming?

a)

Java Development Kit

b)

Java Data Kit

c)

Java Deployment Kit

d)

Java Design Kit

15.

What are the key differences between List and Set in the Java Collection Framework?

a)
List does not allow duplicates and guarantees order.
b)
Set allows duplicates and maintains order.
c)

List Maintains order

d)

List allows duplicates and Set does not allow duplicates

16.

Which method is used to check if a specific element exists in a collection?

a)

has()

b)

find()

c)

exists()

d)

contains()

17.

The retainAll() method of Java Collection Interface keeps only those elements in this queue that are present in the specified collection.

a)

TRUE

b)

FALSE

18.

The addAll(Collection c) method adds all elements of the specified collection to the current collection from index 1.

a)
FALSE
b)
TRUE
19.

In the J2EE architecture, which tier is responsible for handling the business logic?

a)

Middle Tier

b)
Database tier
c)

EIS tier

d)
Client tier
20.

The client request is processed by the (a)  

21.

S______C______ object is used to store data that is accessible to all servlets in a web application?

(a)  

22.

Which of the following best describes the init() method in a servlet?

a)

It is called once for each request.

b)

It is called when the servlet is first loaded

c)

It is called every time a servlet is destroyed.

d)

It is called to handle client requests

23.

(a)   Method in HTTP partially updates a resource on the server

24.

What does the <%-- --%> syntax represent in JSP?

a)

An HTML comment.

b)

A JSP comment.

c)

A Java code block.

25.

Which of the following are valid elements in a JSP page? (Select all that apply)

a)

Directives

b)

Scriptlets

c)

Expressions

d)

Declarations

26.

What concepts are depicted in the image?

a)

JSP Elements

b)

JSP LifeCycle

c)

JSP Compilation

d)

Servlet Lifecycle

27.

What is the primary purpose of the Java Virtual Machine (JVM)?

a)

To compile Java code

b)

To execute Java bytecode

c)

To manage memory

d)

To provide a user interface

28.

(a)   Method is used to send data to a server to create or update a resource

29.

Which of the following are the most appropriate features of Servlet?

a)

 Platform Independence

b)

Portable

c)

 Efficient and scalable

d)

Containerless Sever

30.

Which are valid declarations? (Choose all that apply.)

a)

int $x

b)

int 123

c)

int _123

d)

int #dim

e)

int central_sales_region_Summer_2005_gross_sales

31.

Which are legal declarations? (Choose all that apply.)

a)

short x []

b)

short [] y

c)

short[5] x2

d)

short z2 [5]

32.

___________ methods does not contain any body

a)

abstract

b)

final

c)

static

d)

none

33.

_________________ methods cannot be over ridden

a)

abstract

b)

final

c)

constant

d)

None

34.

What is the environment variable which we should set for locating executable files (.exe,.com)

a)

JAVA_HOME

b)

classpath

c)

path

d)

none

35.

What is the environment variable which we should set for locating classes, jars

a)

JAVA_HOME

b)

classpath

c)

path

d)

none

36.

Set, List, and Map extend the java.util.Collection interface

a)

True

b)

False

37.

Which of the following will not throw a NullPointerException? String s = null

a)

if ((s!=null) & (s.length() > 0))

b)

if ((s!=null) && (s.length() > 0))

c)

if ((s==null) | (s.length() == 0))

d)

a) if ((s==null) || (s.length() == 0))

38.

What are valid keywords

a)

Null

b)

True

c)

Implements

d)

interface

e)

instanceof

39.

What is the access modifier for a class member variable which is to be used in the same package where the class is defined?

a)

Protected

b)

Private

c)

Public

d)

No Access Modifier

e)

Static

40.

What is the body of a Thread

a)

Run

b)

Begin

c)

Execute

d)

Start

e)

Resume

41.

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

a)

const

b)

fixed

c)

public

d)

Static

e)

Final

42.

Connection interface is implemented by

a)

the database

b)

the database driver

c)

the programmer of the jdbc application

d)

None

43.

A thin driver is

a)

Type 1 Driver

b)

Type 2 Driver

c)

Type 3 Driver

d)

Type 4 Driver

44.

What does executeUpdate() method of PreparedStatement interface returns

a)

An object of ResultSet interface

b)

an Object of PreparedStatement

c)

an int value

d)

a String Object

45.

Java was originally named

a)

Oak

b)

C++-++

c)

Advanced C++

d)

Coffee

46.

Java is a (a)   language

47.

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

a)

E-C-A-D-B-F

b)

A-C-B-D-F-E

c)

E-C-B-A-D-F

d)

E-B-C-A-D-F

48.

Which of the following is used to load a .class file?

a)

Class Loader

b)

JIT compiler

c)

Byte Code verifier

d)

Interpreter

49.

JVM stands for (a)  

50.

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

a)

1

b)

2

c)

3

d)

0

51.

Java is a pure object oriented programming language.

a)

Yes

b)

No

52.

The keyword "method" is an another name for?

a)

function

b)

variable

c)

class

d)

object

53.

Where does a java program starts its execution?

a)

class

b)

main

c)

method

d)

object

54.

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);

}

}

a)

Compilation Error

b)

Runtime Error

c)

The program compiles and executes successfully but prints nothing

d)

The program compiles and executes successfully and prints 0

55.

If we want to print "I am new to Java" in java, we have to write (a)  

56.

What is an instance of a class?

a)

Class

b)

Object

c)

Reference

d)

Primitive

57.

Autoboxing converts primitive to corresponding object wrapper class

a)

true

b)

false

58.

What is the default value of a primitive int data type?

a)

-1

b)

null

c)

0

d)

garbage data

59.

Consider the given code. What would be the display on the screen?

a)

Class A

b)

Class B

c)

Class C

d)

Compile error

60.

Composition is a

a)

uses-a relationship

b)

has-a relationship

c)

is-a relationship

d)

none of the above

61.

Enter Your Name

4 lines
62.

Enter Your Enrolment No

4 lines
63.

Enter Your Branch(CSE, CSE-DS, CSE-AIML, CSIT, CY, IT)

4 lines
64.

Enter Your Acropolis Email ID

4 lines
65.

Enter Your Batch(2026 or 2027)

4 lines