Sysarc Infomatix Fresher Interview Questions with answers

Sysarc Infomatix Fresher Interview Questions with answers 

This blog explains about Sysarc Infomatix Fresher Interview Questions with answers . It is illustrated very well below :

____________________________________________________________________

1. What do you mean by Abstract class ?

Abstraction in Java

Abstraction is a process of hiding the implementation details and showing only functionality to the user.

A class which is declared with the abstract keyword is known as an abstract class in Java. It can have abstract and non-abstract methods (method with the body).

Ways to achieve Abstraction

There are two ways to achieve abstraction in java

  1. Abstract class (0 to 100%)
  2. Interface (100%)

Abstract class in Java

A class which is declared as abstract is known as an abstract class. It can have abstract and non-abstract methods. It needs to be extended and its method implemented. It cannot be instantiated.

  • An abstract class must be declared with an abstract keyword.
  • It can have abstract and non-abstract methods.
  • It cannot be instantiated.
  • It can have constructors and static methods also.
  • It can have final methods which will force the subclass not to change the body of the method.

_________________________________________________________________________

2. Explain about Access specifiers in java ?

Access specifiers for classes or interfaces in Java

In Java, methods and data members of a class/interface can have one of the following four access specifiers. The access specifiers are listed according to their restrictiveness order.

1) private
2) default (when no access specifier is specified)
3) protected
4) public

But, the classes and interfaces themselves can have only two access specifiers when declared outside any other class.
1) public
2) default 

For example, following program fails in compilation.

filter_none

edit

play_arrow

brightness_4

//filename: Main.java

protected class Test {}

 

public class Main {

  public static void main(String args[]) {

 

  }

}

_________________________________________________________________________

3. Explain about multithreading in Java ? 

Multithreading in Java

Multithreading in java is a process of executing multiple threads simultaneously.

A thread is a lightweight sub-process, the smallest unit of processing. Multiprocessing and multithreading, both are used to achieve multitasking.

However, we use multithreading than multiprocessing because threads use a shared memory area. They don’t allocate separate memory area so saves memory, and context-switching between the threads takes less time than process.

Java Multithreading is mostly used in games, animation, etc.

Advantages of Java Multithreading

1) It doesn’t block the user because threads are independent and you can perform multiple operations at the same time.

2) You can perform many operations together, so it saves time.

3) Threads are independent, so it doesn’t affect other threads if an exception occurs in a single thread.

____________________________________________________________________

4. Explain about OOPs concept in Java ? 

OOPs (Object-Oriented Programming System)

Object means a real-world entity such as a pen, chair, table, computer, watch, etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects. It simplifies the software development and maintenance by providing some concepts:

  • Object Oriented Programming is a programming concept that works on the principle that objects are the most important part of your program. It allows users create the objects that they want and then create methods to handle those objects. Manipulating these objects to get results is the goal of Object Oriented Programming.
  • Object Oriented Programming popularly known as OOP, is used in a modern programming language like Java
  • ___________________________________________________________________________

 REFERENCES : 

https://www.javatpoint.com/abstract-class-in-java

https://www.geeksforgeeks.org/access-specifiers-for-classes-or-interfaces-in-java/

https://www.javatpoint.com/multithreading-in-java

https://www.guru99.com/java-oops-concept.html