Posts

Showing posts from June, 2022

Top 100 java interview Question

  Questions 1) What is the difference between String and StringBuffer...and what is that property called for String objects? 2) What will happen if u get an error in run() method of thread and if there is no try catch block for that? 3) What is Synchronization? 4) What is deadlock? 5) Write sample code using wait() and notify() methods? 6) If a thread has obtained a lock on an object. can other threads invoke non-synchronized methods on the same object? 7) Explain the Exception hierarchy? 8) What are the diff b/w checked exceptions and unchecked exceptions and errors? 9) How to write our own exceptions? And can we write them without using super() in that? 10) What is encapsulation? Why do u need that? 11) Difference b/w Readers and Streams in I/O? 12) How to open a file in read write mode? 13) There is a Date class in java.util. Is there any other package that has the Date class? 14) If we import java.util.Date and java.sql.Date and use Date d= new Date()..what happens? 15) What is...

Hibernate Interview Question

Q1: What is ORM?  Object Relational Mapping (ORM): ORM is a theoretical approach that provides the concept of converting an object to a DB record and vice-version. If follows are concepts i.e., mapping it will be done in between the java class and the Database table. Q2: What is Hibernate? what is the feature of Hibernate? HIBERNATE: Hibernate is an ORM Framework. It follows java API’s like JDBC, JNDI, JTA .   JDBC : Java Database Connectivity.   JNDI : Java Naming Directory Interface.  JTA : Java Transaction API. And also uses XML (non-Java Technology).   Hibernate provides an In-built Persistency API to perform Single Row Operations without SQL by the programmer. Like insert (Save(), Delete(), Update()), read (get() or load()).   Hibernate supports Transaction Management begin Transaction, Commit, rollback transaction, etc...(in-built).   Hibernate supports Connection Pooling (Multiple Connections are Maintained as a memory for re-using).  ...

Java8 Interview Question

The main feature of Java 8 is to support functional programming.  many other languages are supporting functional programming but  befor e java 8, java is only an object-oriented programming language, and we are missin g func tional programming features. Java community identifies these problems and introduced functional programming in java 8.   Q1: List out the Java 8  Features ? Below are the features introduced in Java8 1. Functional Interface 2. Lambda Expressions  3 .  Default Method 4. Method References 5. Stream API 6. Optional 7. New Date and Time API  8 .  Nashorn Q2: What is Functional Interface, What is the use of this? Functional Interfaces:  An interface that contains only a single abstract method (SAM) is called a functional interface.   ->To invoke lambda expression functional interface is required. ->A functional interface can contain any number of default and static methods but It should contain only one abstrac...