WorksheetsJava Fullstack
Total questions: 75
Worksheet time: 43mins
Which annotation in the Spring Framework is a convenience annotation that combines @Controller and @ResponseBody to simplify the development of RESTful web services?
@Component
@RestController
@Repository
What is the correct HTML element to define important text?
<strong>
<b>
<important>
<i>
How can you open a link in a new tab or window?
<a href="url" new>
<a href="url" target="_self">
<a href="url" target="_blank">
<a href="url" window="_blank">
Which tag is used to define a table in HTML?
<tab>
<tr>
<td>
<table>
How can you make a numbered list?
<list>
<dl>
<ul>
<ol>
How do you make the text bold using CSS?
font-style: bold;
text-style: bold;
font-weight: bold;
font-size: bold;
How do you center a block element horizontally?
text-align: center;
margin: center;
margin-left: auto; margin-right: auto;
position: center;
Which of the following properties is used to add spacing inside an element?
margin
padding
border
outline
How can you add a JavaScript file to an HTML document?
<script href="script.js">
<script src="script.js">
<script link="script.js">
<link src="script.js">
What is the output of 2 + 5 + "7" in JavaScript?
"257"
14
"12"
"77"
Which method is used to find the length of a string in JavaScript?
length()
getLength()
len()
length
Which method is used to find the length of a string in JavaScript?
length()
getLength()
len()
length
What does the typeof operator return for an array in JavaScript?
"object"
"array"
"list"
"undefined"
Which of the following is a web development paradigm?
A. Object-Oriented Programming
B. Procedural Programming
C. Functional Programming
D. Model-View-Controller
Which of the following is a version control system?
A) Git
B) MySQL
C) MongoDB
D) PostgreSQL
What is the purpose of a database in Full Stack Development?
A) To store and organize data
B) To create user interfaces
C) To manage server-side logic
D) None of the above
Which of the following is NOT a common web application architecture?
A) Model-View-Controller (MVC)
B) Model-View-ViewModel (MVVM)
C) Model-View-Presenter (MVP)
D) Model-View-Database (MVD)
Which of the following is a relational database management system?
a) MongoDB
b) Redis
c) SQLite
d) Elasticsearch
Which of the following is the correct main() method signature in Java?
public static void main (String [] args)
public static void Main (String [] args)
public static void main (string [] args)
public static void main (String args)
Which of the following is a valid variable declaration in Java?
int 1myInteger = 0;
int int = 0;
Int my Integer = 0;
int myInteger = 0;
Which Java data type is used to store 64-bit floating-point numbers?
int
long
float
double
Is String a primitive data type?
Yes
No
Both
Which method to use to find length of a string?
length()
size()
long()
count()
Which data type gets returned from length() method in String class?
double
String
int
number
Which is correct method to convert String into uppercase
changeUpperCase()
convertUpperCase()
toUpper()
toUpperCase()
String txt = "Hello World";
System.out.println(txt.toUpperCase());
Choose the correct output.
"HELLO WORLD"
HELLO WORLD
Hello world
Error
Long is 4 byte size in storage?
True
False
char is 2 byte in storage?
True
False
Which of the following is not a Java features?
Dynamic
Architecture Neutral
Use of pointers
Object-oriented
_____ is used to find and fix bugs in the Java programs.
JVM
JRE
JDK
JDB
Which of the following for loop declaration is not valid?
for ( int i = 99; i >= 0; i / 9 )
for ( int i = 7; i <= 77; i += 7 )
for ( int i = 20; i >= 2; - -i )
for ( int i = 2; i <= 20; i = 2* i )
When does method overloading is determined?
At run time
At compile time
At coding time
At execution time
Which concept of Java is achieved by combining methods and attribute into a class?
Encapsulation
Inheritance
Polymorphism
Abstraction
Which component is used to compile, debug and execute java program?
JVM
JDK
JIT
JRE
Which of the below is invalid identifier with the main method?
public
static
final
private
What is the extension of compiled java classes?
.java
.class
.txt
.js
Which of these statement is incorrect?
Every class must contain a main() method
Applets do not require a main() method at all
There can be only one main() method in a program
main() method must be made public
Which of the following statements is correct?
Public method is accessible to all other classes in the hierarchy
Public method is accessible only to subclasses of its parent class
Public method can only be called by object of its class
Public method can be accessed by calling object of the public class
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 + " ");
}
}
10 20
20 10
10 10
20 20
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);
}
}
10 10
20 20
10 20
20 10
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 + " ");
}
}
}
1 3 9
1 2 3 … 9
3 5 7 9 11 13 15 17 19
None
which of the following is wrapper class in java
Float
Integer
Double
all of above
which one of the following is a legal decelration of a two- dimensional array of integers
int[] a[] = new int[5][];
int[5][5] a = new int[][];
int a = new int[5,5];
int[][] a = new int[][5];
What is React in the context of web development?
CSS Framework
JavaScript Library
JavaScript Framework
Frontend Tool
What is the main advantage of using React in a web development project?
Efficient DOM manipulation
Server-side rendering
Database management
Backend development
Explain the concept of state in React components.
State is used for storing data that can change over time
State is used for defining the structure of components
State is used for handling routing in React applications
State is used for server-side rendering of components
What is the purpose of using keys in React lists?
To uniquely identify list items and improve performance
To apply different styles to list items
To manage state within list components
To create nested lists efficiently
What is the main difference between state and props in React?
State is mutable and controlled by the component itself, while props are immutable and passed down from parent components
State is immutable and passed down from parent components, while props are mutable and controlled by the component itself
State is used for styling components, while props are used for managing state
State is used for server-side rendering, while props are used for client-side rendering
Which company developed React.js?
A) Google
B) Microsoft
C) Facebook
D) Twitter
Which of the following is used to create a functional component in React?
A) class MyComponent extends React.Component
B) function MyComponent() { return <div>Hello</div>; }
C) React.createComponent(MyComponent)
D) new React.Component(MyComponent)
Which method is used to update the state in a React class component?
A) updateState()
B) setState()
C) changeState()
D) modifyState()
Which of the following is a correct way to pass a prop to a component?
A) <MyComponent prop="value" />
B) <MyComponent {prop: "value"} />
C) <MyComponent.prop = "value" />
D) <MyComponent prop["value"] />
Which Hook is used to manage state in a functional component?
A) useEffect
B) useState
C) useReducer
D) useContext
What is React JS?
A JavaScript library for building user interfaces
A server-side framework for building web applications
A programming language for building web applications
A front-end framework for building mobile applications
React component can return how many parent html tags
one
multiple
two
three
Which statements are true about a React Component? Select all that apply.
It can be written as a Class
It can be written as a Function
It returns HTML
Bypasses the need for a HTML document alltogether
What is the core container module in the Spring Framework?
Spring Boot
Spring Web
Spring MVC
Spring IoC
What is the purpose of the @Autowired annotation in Spring?
It defines a new bean
It injects dependencies automatically
It configures database connections
It specifies URL patterns
What does the term "Inversion of Control" (IoC) refer to in Spring?
A control statement in programming logic
A design pattern for creating classes
The process of controlling hardware devices
The management of object dependencies by a container
Which of the following is not a Spring Boot annotation?
@Controller
@RestController
@Service
@Data
Which of the following annotation is used for REST web services?
@Controller
@RestController
@Application
@SpringBootApplication
What is the default HTML template engine in Spring Boot?
Jakarta Server Pages (JSP)
Thymeleaf
Freemarker
HTML
Which of the following is/are advantages of Spring MVC Framework?
The Spring MVC separates each role, where the model object, controller, command object, view resolver, DispatcherServlet, validator, etc.
The Spring MVC facilitates fast and parallel development.
Instead of creating new objects, spring mvc allows us to use the existing business objects.
All of the above
@RequestMapping(value = "/hospitals/{id}", method = RequestMethod.GET) How to get the value of id in controller method?
@Variable("id")
@PathVariable("id")
@RequestVariable("id")
None of the above
Which Spring annotation can be used to expose a controller as REST API?
@Controller
@RestAPIController
@RestController
@AppController
Which specification allows ORM over RDBMS?
Spring Persistence API
Spring ORM API
Java Persistence API
Java ORM API
What are the HTTP methods that cannot be implemented in Spring Boot Rest Service?
GET
POST
PUT
PATCH
In JPA, these are representing data that can be persisted to the database. It represents a table stored in a database.
Service
JPA Table
ORM
Entities
What is the maximum number of columns in the Bootstrap grid system?
8
10
12
16
How do you specify the width of a column in Bootstrap?
Using the .size-{size} class
Using the .col-{breakpoint}-{size} class
Using the .width-{size} class
Using the .column-{size} class
What method is used to add an element to a List in Java?
D) push()
C) add()
B) insert()
A) addElement()
