Delivery Exam
Delivery Exam
1)Which exception class is bound to all the exceptions thrown in Spring applications?
Ans)ArrayIndexOutofBound
DataAccessException
NullPointerException
Springexception
3)Which exception class is bound to all the exception thrown in spring applications ?
Ans)ArrayIndexOutofBound
DataAccessException
NullPointerException
SpringException
Ans) TRUE
FALSE
6)Which of these method of thread class is used to suspend a thread for a period of time?
Ans) Sleep()
Terminate()
Suspend()
Stop()
7)A bean can have more than one name in spring boot using multiple attributes
Ans)TRUE
FALSE
Ans) @Controller
@RestController
@Service
@Data
9) Which of the following statement is correct regarding the difference between TRUNCATE,
DELETE and DROP Command
1 DELETE operation can be rolled back but TRUNCATE and DROP operations cannot be rolled
back.
II TRUNCATE and DROP operations can be rolled back but DELETE operations cannot be rolled
back.
III. DELETE is an example of DML, but TRUNCATE and DROP are examples of DDL.
OPTIONS:
II and III
I and III
II and IV
Ans)FALSE
byName
byType
Ans) @PreDestory
@PostConstruct
@PropertySource
@ComponentSource
Code:
class Hackjava {
int i=1,s=0;
s=s+i;
i++; }
System.out.println(s);}}
Ans)
15
21
Syntax Error
13) In Stist web services, you are working on REST-based architecture. Which of the following
Statements:
4. The PUT method is used to update an existing resource or create a new resource.
Ans)1,2 and 3
2,3 and 4
1,2 and 4
1,3 and 4
14)In REST API web services, which of these methods is used to remove configuration on a
device in the following statement.
HTTP______[devices/[id]/configuration/[id]
Ans)POST
DELETE
OPTIONS
PUT
15) John is working on java. While working on an application, he wants to skip the current
iteration of a loop and move to the next body for the current iteration. Help him to find the
following can be used in the above mentioned context.
Ans)break
Exit
Continue
16)import java.util.*;
class Hacker{
return a*b/a;
return a*b/c;
class Hackeroverload{
System.out.println(Hacker.add(2,4,6));
Ans)6 1
return this.name;
class Main {
d.setName("Hacker");
System.out.println(d.getName());
d.setName("earth");
System.out.println(d.getName());
Ans) Hacker
Earth
18) Which exception class is bound to all the exceptions thrown in Spring applications?
Ans) DataAccessException
19) class Hacker{ public static void main(String[] args){ try { int res = 5% 0;} catch
(ArithmeticException e) { System.out.println("ArithmeticException => " + e.getMessage());} finally
{ System.out.println("This is the final result"); }}}
20) working on lava, While working on an application, he wants to skip the current monson of a
body for the current iteration. Help him to find which of the following can be used in the
Ans)continue
21) In Spring, which of the following methods is not supported by the Thread class? public void
run() public void start() public void exit() public final int getPriority()
Ans) public void exit()
22) Bob is working on MicroServices. While working on the above mentioned context
Statements:
2. It decreases the errors at the same time. application he wants know about the benefits of
using an AM gatory Help how to fed whe
3. It increases the number of round trips between the client and the application.
Ans)1 2 4
23) Ben wants to use the ApplicationContext loC Container in one of his programs during
deveter
25) Which among the following classes is considered as an entry point to an Spring Web MVC
project?
Ans) DispatcherServlet
import java.io.*;
public class Hackerearth {
public Hackerearth() {
System.out.println("HackerEarth");
Hackerearth b;
b = new Hackerearth();
Ans)HackerEarth
HackerEarth
Ans) Weaving is the process of linking an aspect with other application types or objects to create
an advised object
import java.io.*;
char i = 'a'; // Corrected the variable name and assigned it a character value
case 'a': // Corrected the case label to match the character value
break;
default:
28) Ben decided to use the PUI method in his REST API web service. Which of the following is
the reavons touse app
29) While working on a project using Java Hob made a class. Now her wishes to convert that
class into an entity.which among the following options is needed in order to convert It?
30) Table: product p_code p_name Price 1 Paul 1015 2 John 15.99 3 Mary 15.50 4 Lisa 25.25 5 Anita
30.33 6 Tara 15.55 Which of these Sql queries must be used to round off the price to one decimal
place in the above product table?
31) What is the name of the thread in output in the following Java program? class
multithreaded_programing { public static void main(String args[]) { Threadt Thread.currentThread();
System.out.println(t.isAlive()); } }
Ans) True
32) In an application, Ben has designed several endpoints but just for validation purposes, he
wants to know the methods aflowers for pr Following methods would he use to achieve this?
Ans)OPTIONS
33) Alice is working on a project on Java using J2EE While witing the code for the required
application.servlet
Ans ServletException
34) In HTML5, you are woning on mulheresa atributes You have repanted a met exmer that can
occur while configuring the request. If you are required to contigues of the following
configuration syntax must be used to perform this task?
35) In HTML h. you are woning on Web Forms 20 Which of StatemenER 1 The for attribute is
used to determine the relationship between the result of the 2. The form attribute is used to
determine the form to which the output tog in reci 3. The name attribute is used to determine
the name of the output element
1 and 2
2 and 3 DOUBT
1 and 3
All of these
36) John is working on Java While working on an application, he wants to know about the differenc
of the following statements is/are correct about the above-mentioned context 1 at is used for
floating-point numbers, while double is used for integers 2 art is a 64-bit data type, while double is a
32-bit data type 33nt is a signed data type that can hold values from -2,147,483,648 to
2,147,483,647, while dou small numbers with decimal places 4 Int is a floating-point data type that
can hold very large and very small numbers with decima from 2,147,483,648 to 2,147,483,647
Ans)1
37)
CODING
MINIMUMCOST
1) create database minicost;
use minicost;
CREATE TABLE products (
product_id INT,
product_name VARCHAR(255),
cost INT,
category VARCHAR(255)
);
show tables;
2)BANK
CREATE DATABASE bank_database;
SELECT Customer_ID
FROM bank
WHERE MONTH(Info_Date) = 10
ORDER BY Customer_ID ASC;
3)CANDLES
package com.candles;
import java.util.Scanner;
return total;
}
}
4)METHOD OVERRIDING
package com.overriding;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
class Polygon {
protected List<Double> sides;
@Override
public double getArea() {
return side1 * side2;
}
}
@Override
public double getArea() {
return side * side;
}
}
scanner.close();
}
}
5)REMOVE WHITE SPACES
package com.RemoveSpaces;
import java.util.Scanner;
System.out.println(output);
scanner.close();
}
return result.toString();
}
}
6)SECOND HEIGHEST
package com.secondhighest;
import java.util.Scanner;
System.out.println( secondHighest);
scanner.close();
}
}
7)TAXPAYMENT
package com.TaxPayment;
import java.util.*;
scanner.close();
}
int count = 0;
for (int i = l - 1; i < r; i++) {
if (A[i][1] > x) {
count++;
}
}
result.add(count);
}
return result;
}
}