wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Fullstack

Total questions: 75

Worksheet time: 43mins

Name
Class
Date
1.

Which annotation in the Spring Framework is a convenience annotation that combines @Controller and @ResponseBody to simplify the development of RESTful web services? 

a)

@Component

b)

@RestController

c)

@Repository

2.

What is the correct HTML element to define important text?

a)

 <strong>

b)

<b>

c)

<important>

d)

<i>

3.

How can you open a link in a new tab or window?

a)

 <a href="url" new>

b)

 <a href="url" target="_self">

c)

 <a href="url" target="_blank">

d)

 <a href="url" window="_blank">

4.

Which tag is used to define a table in HTML?

a)

 <tab>

b)

<tr>

c)

<td>

d)

<table>

5.

How can you make a numbered list?

a)

<list>

b)

<dl>

c)
  • <ul>

d)
  1. <ol>

6.

How do you make the text bold using CSS?

a)

font-style: bold;

b)

text-style: bold;

c)

font-weight: bold;

d)

font-size: bold;

7.

How do you center a block element horizontally?

a)

text-align: center;

b)

margin: center;

c)

margin-left: auto; margin-right: auto;

d)

position: center;

8.

Which of the following properties is used to add spacing inside an element?

a)

margin

b)

padding

c)

border

d)

outline

9.

How can you add a JavaScript file to an HTML document?

a)

<script href="script.js">

b)

<script src="script.js">

c)

<script link="script.js">

d)

<link src="script.js">

10.

What is the output of 2 + 5 + "7" in JavaScript?

a)

"257"

b)

14

c)

"12"

d)

"77"

11.

Which method is used to find the length of a string in JavaScript?

a)

length()

b)

getLength()

c)

len()

d)

length

12.

Which method is used to find the length of a string in JavaScript?

a)

length()

b)

getLength()

c)

len()

d)

length

13.

What does the typeof operator return for an array in JavaScript?

a)

"object"

b)

"array"

c)

"list"

d)

"undefined"

14.

Which of the following is a web development paradigm?

a)

A. Object-Oriented Programming

b)

B. Procedural Programming

c)

C. Functional Programming

d)

D. Model-View-Controller

15.

Which of the following is a version control system?

a)

A) Git

b)

B) MySQL

c)

C) MongoDB

d)

D) PostgreSQL

16.

What is the purpose of a database in Full Stack Development?

a)

A) To store and organize data

b)

B) To create user interfaces

c)

C) To manage server-side logic

d)

D) None of the above

17.

Which of the following is NOT a common web application architecture?

a)

A) Model-View-Controller (MVC)

b)

B) Model-View-ViewModel (MVVM)

c)

C) Model-View-Presenter (MVP)

d)

D) Model-View-Database (MVD)

18.

Which of the following is a relational database management system?

a)

a) MongoDB

b)

b) Redis

c)

c) SQLite

d)

d) Elasticsearch

19.

Which of the following is the correct main() method signature in Java?

a)

public static void main (String [] args)

b)

public static void Main (String [] args)

c)

public static void main (string [] args)

d)

public static void main (String args)

20.

Which of the following is a valid variable declaration in Java?

a)

int 1myInteger = 0;

b)

int int = 0;

c)

Int my Integer = 0;

d)

int myInteger = 0;

21.

Which Java data type is used to store 64-bit floating-point numbers?

a)

int

b)

long

c)

float

d)

double

22.

Is String a primitive data type?

a)

Yes

b)

No

c)

Both

23.

Which method to use to find length of a string?

a)

length()

b)

size()

c)

long()

d)

count()

24.

Which data type gets returned from length() method in String class?

a)

double

b)

String

c)

int

d)

number

25.

Which is correct method to convert String into uppercase

a)

changeUpperCase()

b)

convertUpperCase()

c)

toUpper()

d)

toUpperCase()

26.

String txt = "Hello World";

System.out.println(txt.toUpperCase());


Choose the correct output.

a)

"HELLO WORLD"

b)

HELLO WORLD

c)

Hello world

d)

Error

27.

Long is 4 byte size in storage?

a)

True

b)

False

28.

char is 2 byte in storage?

a)

True

b)

False

29.

Which of the following is not a Java features?

a)

Dynamic

b)

Architecture Neutral

c)

Use of pointers

d)

Object-oriented

30.

_____ is used to find and fix bugs in the Java programs.

a)

JVM

b)

JRE

c)

JDK

d)

JDB

31.

Which of the following for loop declaration is not valid?

a)

for ( int i = 99; i >= 0; i / 9 )

b)

for ( int i = 7; i <= 77; i += 7 )

c)

for ( int i = 20; i >= 2; - -i )

d)

for ( int i = 2; i <= 20; i = 2* i )

32.

When does method overloading is determined?

a)

At run time

b)

At compile time

c)

At coding time

d)

At execution time

33.

Which concept of Java is achieved by combining methods and attribute into a class?

a)

Encapsulation

b)

Inheritance

c)

Polymorphism

d)

Abstraction

34.

Which component is used to compile, debug and execute java program?

a)

JVM

b)

JDK

c)

JIT

d)

JRE

35.

Which of the below is invalid identifier with the main method?

a)

public

b)

static

c)

final

d)

private

36.

What is the extension of compiled java classes?

a)

.java

b)

.class

c)

.txt

d)

.js

37.

Which of these statement is incorrect?

a)

Every class must contain a main() method

b)

Applets do not require a main() method at all

c)

There can be only one main() method in a program

d)

main() method must be made public

38.

Which of the following statements is correct?

a)

Public method is accessible to all other classes in the hierarchy

b)

Public method is accessible only to subclasses of its parent class

c)

Public method can only be called by object of its class

d)

Public method can be accessed by calling object of the public class

39.

what is the output of this question?

class Test1 {

public

static void main(String[] args)

{

int x = 20;

System.out.println(x);

}

static

{

int x = 10;

System.out.print(x + " ");

}

}

a)

10 20

b)

20 10

c)

10 10

d)

20 20

40.

what is the output of this question?

class Test1 {

static int x = 10;

public

static void main(String[] args)

{

Test1 t1 = new Test1();

Test1 t2 = new Test1();

t1.x = 20;

System.out.print(t1.x + " ");

System.out.println(t2.x);

}

}

a)

10 10

b)

20 20

c)

10 20

d)

20 10

41.

What is the output of this question?

class Test1 {

static int i = 1;

public static void main(String[] args)

{

int i = 1;

for (Test1.i = 1; Test1.i < 10; Test1.i++) {

i = i + 2;

System.out.print(i + " ");

}

}

}

a)

1 3 9

b)

1 2 3 … 9

c)

3 5 7 9 11 13 15 17 19

d)

None

42.

which of the following is wrapper class in java

a)

Float

b)

Integer

c)

Double

d)

all of above

43.

which one of the following is a legal decelration of a two- dimensional array of integers

a)

int[] a[] = new int[5][];

b)

int[5][5] a = new int[][];

c)

int a = new int[5,5];

d)

int[][] a = new int[][5];

44.

What is React in the context of web development?

a)

CSS Framework

b)

JavaScript Library

c)

JavaScript Framework

d)

Frontend Tool

45.

What is the main advantage of using React in a web development project?

a)

Efficient DOM manipulation

b)

Server-side rendering

c)

Database management

d)

Backend development

46.

Explain the concept of state in React components.

a)

State is used for storing data that can change over time

b)

State is used for defining the structure of components

c)

State is used for handling routing in React applications

d)

State is used for server-side rendering of components

47.

What is the purpose of using keys in React lists?

a)

To uniquely identify list items and improve performance

b)

To apply different styles to list items

c)

To manage state within list components

d)

To create nested lists efficiently

48.

What is the main difference between state and props in React?

a)

State is mutable and controlled by the component itself, while props are immutable and passed down from parent components

b)

State is immutable and passed down from parent components, while props are mutable and controlled by the component itself

c)

State is used for styling components, while props are used for managing state

d)

State is used for server-side rendering, while props are used for client-side rendering

49.

Which company developed React.js?

a)

A) Google

b)

B) Microsoft

c)

C) Facebook

d)

D) Twitter

50.

Which of the following is used to create a functional component in React?

a)

A) class MyComponent extends React.Component

b)

B) function MyComponent() { return <div>Hello</div>; }

c)

C) React.createComponent(MyComponent)

d)

D) new React.Component(MyComponent)

51.

Which method is used to update the state in a React class component?

a)

A) updateState()

b)

B) setState()

c)

C) changeState()

d)

D) modifyState()

52.

Which of the following is a correct way to pass a prop to a component?

a)

A) <MyComponent prop="value" />

b)

B) <MyComponent {prop: "value"} />

c)

C) <MyComponent.prop = "value" />

d)

D) <MyComponent prop["value"] />

53.

Which Hook is used to manage state in a functional component?

a)

A) useEffect

b)

B) useState

c)

C) useReducer

d)

D) useContext

54.

What is React JS?

a)

 A JavaScript library for building user interfaces

b)

A server-side framework for building web applications

c)

A programming language for building web applications

d)

A front-end framework for building mobile applications

55.

React component can return how many parent html tags

a)

one

b)

multiple

c)

two

d)

three

56.


Which statements are true about a React Component? Select all that apply.

a)

It can be written as a Class

b)

It can be written as a Function

c)

It returns HTML

d)

Bypasses the need for a HTML document alltogether

57.

What is the core container module in the Spring Framework?

a)

Spring Boot

b)

Spring Web

c)

Spring MVC

d)

Spring IoC

58.

What is the purpose of the @Autowired annotation in Spring?

a)

It defines a new bean

b)

It injects dependencies automatically

c)

It configures database connections

d)

It specifies URL patterns

59.

What does the term "Inversion of Control" (IoC) refer to in Spring?

a)

A control statement in programming logic

b)

A design pattern for creating classes

c)

The process of controlling hardware devices

d)

The management of object dependencies by a container

60.

Which of the following is not a Spring Boot annotation?

a)

@Controller

b)

@RestController

c)

@Service

d)

@Data

61.

Which of the following annotation is used for REST web services?

a)

@Controller

b)

@RestController

c)

@Application

d)

@SpringBootApplication

62.

What is the default HTML template engine in Spring Boot?

a)

Jakarta Server Pages (JSP)

b)

Thymeleaf

c)

Freemarker

d)

HTML

63.
What stands true for spring framework?
a)
Spring framework is a light weight framework.
b)
Spring framework is a heavy weight framework.
64.
What is the basic concept of Spring?
a)
Factory pattern
b)
Singleton pattern
c)
Dependency injection or Inversion of control
d)
Abstract factory pattern
65.
What are all IDE can be used for Spring boot Development
a)
Intelli J
b)
Eclipse
c)
Spring Tool Suite(STS)
d)
All the Above.
66.
What is an ORM?
a)
Object Relational Mapper
b)
Alternative to JDBC
67.

Which of the following is/are advantages of Spring MVC Framework?

a)

The Spring MVC separates each role, where the model object, controller, command object, view resolver, DispatcherServlet, validator, etc.

b)

The Spring MVC facilitates fast and parallel development.

c)

Instead of creating new objects, spring mvc allows us to use the existing business objects.

d)

All of the above

68.

@RequestMapping(value = "/hospitals/{id}", method = RequestMethod.GET) How to get the value of id in controller method?

a)

@Variable("id")

b)

@PathVariable("id")

c)

@RequestVariable("id")

d)

None of the above

69.

Which Spring annotation can be used to expose a controller as REST API?

a)

@Controller

b)

@RestAPIController

c)

@RestController

d)

@AppController

70.

Which specification allows ORM over RDBMS?

a)

Spring Persistence API

b)

Spring ORM API

c)

Java Persistence API

d)

Java ORM API

71.

What are the HTTP methods that cannot be implemented in Spring Boot Rest Service?

a)

GET

b)

POST

c)

PUT

d)

PATCH

72.

In JPA, these are representing data that can be persisted to the database. It represents a table stored in a database.

a)

Service

b)

JPA Table

c)

ORM

d)

Entities

73.

What is the maximum number of columns in the Bootstrap grid system?

a)

8

b)

10

c)

12

d)

16

74.

How do you specify the width of a column in Bootstrap?

a)

Using the .size-{size} class

b)

Using the .col-{breakpoint}-{size} class

c)

Using the .width-{size} class

d)

Using the .column-{size} class

75.

What method is used to add an element to a List in Java?

a)

D) push()

b)

C) add()

c)

B) insert()

d)

A) addElement()