Posts

#2 Random Questions for practice on Basic Java Programing

  #2 Random Questions for practice on Basic Java Programing Q #11) What is Encapsulation? Answer: Purpose of Encapsulation: ·          Protects the code from others. ·          Code maintainability. ·          Wrapping of details ·          Can be achive by getter and setter Example: We are declaring ‘a’ as an integer variable and it should not be negative. public class Addition(){ int a=5;  } If someone changes the exact variable as “ a = -5”  then it is bad. In order to overcome the problem we need to follow the steps below: ·          We can make the variable private or protected. ·          Use public accessor methods such as set<property> and get<property>. So that the ab...

#1 Random Questions for practice on Basic Java Programing

  Random Questions  for practice on Basic Java Programing Given below is a comprehensive list of the most important and commonly asked basic and advanced Java programming interview questions with detailed answers. Q #1) What is JAVA? Answer:  Java is a high-level programming language and is platform-independent. Java is a collection of objects. It was developed by Sun Microsystems. There are a lot of applications, websites, and games that are developed using Java. Q #2) What are the features of JAVA? Answer: Features of Java are as follows: OOP concepts ·          Object-oriented ·          Inheritance ·          Encapsulation ·          Polymorphism ·          Abstraction Platform independent:  A single program works on differ...