Interface in Java | Extending, Implementing Interface

What is Interface in Java An interface in Java is a mechanism which is used to achieve completely abstraction. It is basically a kind of class but can have only abstract methods declaration and constants as members.  In other words, an interface in Java is a collection of abstract methods … Read more

Java String toUpperCase() | Example Program

The Java String toUpperCase() method converts all the lowercase letters of a string into upper case and returns that upper-cased string. It has the following general form.Syntax:   1.  public String toUpperCase() 2.  public String toUpperCase(Locale locale)The second method converts all the characters of a string into uppercase using the rules of specified locale. Let’s see … Read more

12 Real Java Encapsulation Interview Questions Answers

1. What is Encapsulation in Java? Why is it called Data hiding? Ans: The process of binding data and corresponding methods (behavior) together into a single unit is called encapsulation in Java. In other words, encapsulation is a programming technique that binds the class members (variables and methods) together and … Read more

Access Modifiers Interview Questions Answer

Access Modifiers Questions asked in Interview 1. How many types of Modifiers in Java? There are two types of Modifiers in Java:          a) Access Modifiers          b) Non- access Modifiers   2. What are the access modifiers in java? Access Modifiers are the … Read more