Posts

Showing posts from January, 2023

Interview Preparation: Interfaces

Image
8   BRILLIANT ANSWERS TO SOFTWARE ENGINEERING INTERVIEW QUESTIONS! 👍 Q 1. What is an interface in Java and why would you, as a software developer,  use interfaces? a)      Interface in java An Interface in the Java programming language is defined as an abstract type that is used to specify the behavior of the class. In java, interface is a blueprint of the behavior. The Java interface contains static constants and abstract methods. The interface in a Java is the mechanism to achieve abstraction. There can be only the abstract methods in Java interface, not a method body. It is used to achieve abstraction and multiple inheritance in java. In other words, we can say that the interfaces can have abstract methods and variables. It cannot have the method body. Java Interface also represents the IS-A relationship. When we decide the type of entity by its behavior and not through the attribute, we should define it as the interface. Like the class, int...

Interview Preparation: Concurrency

Image
12  BRILLIANT ANSWERS TO SOFTWARE ENGINEERING INTERVIEW QUESTIONS! Q 1. What is the difference between process and thread? Any program is under process. Process control block regulates any function.  Process control block contains information about processes like a priority, process ID, state, CPU usage, register usage, and other information. The thread is part of a process.  This can refer to several threads inside the process as well as multiple processes with duplicate threads. Q 3. How do you create a thread in Java and run it? Steps for Creating a Thread ·         Create a class that extends a thread class or implements runnable to the interface. (both are found in Java.lang package). ·         Write or provide the body of the Run () method. ·         Create an object of that class that contains the run () method. ·     ...