Nice Interview questions
- Explain Encapsulation and abstraction
- How can you achieve abstraction
- What is constructor in Java?explain the types of constructor
- Can we make Constructor as private?
- What is singleton class? Write java code for it
- What is static block?
- Explain JDK, JRE and JVM in detail
- What is class loader?
- Explain polymorphism
- What is method hiding? how can you achieve it
- What is interface? where you use it
- Explain different type of access specifiers in java
- Write Program to print Fibonacci series
- Write program to find maximum element in an array
- Write SQl query to find 5th maximum marks from student table
- WHat is deep shadow and copy shadow in java. Explain it with a writing program.
- How you inject dependency in springboot
- How Can you change JAVA version
- Where you add configuration setting in spring boot project
- Explain pom.xml file. and what it contains
- What is association
- Explain Java 8 features
- What is stream API? how you use it
- Explain solid principles
- Expain Multithreading how you write code for threads
- Any idea about build tools?
- Difference between hasmap and hashtable
- difference between linkedlist and arraylist? which is fast?
- What is association
- What is SpringBootApplication Annotation? Can we write it more than one time in an application
- What is stringBuilder and stringBuffer explain it
- What do you understand by string pool
- How have you done unit testing?
- Difference between Soap and Rest API
- What are Designing pattern
- How do you pass parameters in rest apis
- What is requestMapping and getMapping
- Explain @ComponentScan
- Explain exception handling
- Can you write try block without using catch?
- How can you prioritize multiple catch blocks
- What is hibernate
- Have you previously used Kafka?
- What is failed fast?
- what is actuators and end point?
- Differnce between == operator and equal method
- Which kind of Complex SQL query have your written
class Student {
public int id;
public String name;
public Student(String name, int id) {
this.name = name;
this.id = id;
}
public int hashCode() {
return this.id;
}
public String toString() {
return "Student: " + this.name + "@" + Integer.toHexString(hashCode());
}
public boolean equals(Object o) {
if (o instanceof Student) {
Student s = (Student) o;
return s.id == this.id ? true : false;
}
return false;
}
}
public class UpdateHashSet {
public static void main(String[] args) {
HashSet<Student> studentList = new HashSet<>();
Student st1 = new Student("Nimit", 1);
Student st2 = new Student("Rahul", 3);
Student st3 = new Student("Nimit", 2);
studentList.add(st1);
studentList.add(st2);
studentList.add(st3);
System.out.println(studentList.size()); //3
st1.id = 3;
System.out.println(studentList.size()); //2
}
}
What will be the output?
Q2
Table Name : Student
Column : Name, Subject, Marks
Rama Math 50
Rama Physics 60
Rama English 45
Hari Math 70
Hari Physics 65
Hari English 85
Gita Math 90
Gita Physics 55
Gita English 80
Expected Output:
Gita 225
Hari 220
Rama 155
Print the Students In Notice board format.
(i.e Calculate the Toal mark for an individual student,
and print in descending order of total marks.)
Write java program to remove duplicates from an array and assign null or 0 in the end
https://www.onlinegdb.com/fork/b8BWV6xPT
Comments
Post a Comment