
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Maruthi Krishna has Published 870 Articles

Maruthi Krishna
421 Views
No, we cannot implement one interface from another you can just extend it using the extends keyword as −interface ArithmeticCalculations{ public abstract int addition(int a, int b); public abstract int subtraction(int a, int b); } interface MathCalculations implements ArithmeticCalculations{ public abstract double squareRoot(int a); public abstract ... Read More

Maruthi Krishna
352 Views
Defining a class within an interface is allowed in Java. If the methods of an interface accept a class as an argument and the class is not used elsewhere, in such cases we can define a class inside an interface.ExampleIn the following example we have an interface with name CarRentalServices ... Read More

Maruthi Krishna
5K+ Views
Interface in Java is similar to class but, it contains only abstract methods and fields which are final and static.Since all the methods are abstract you cannot instantiate it. To use it, you need to implement this interface using a class and provide body to all the abstract methods int ... Read More

Maruthi Krishna
2K+ Views
Interface in Java is similar to class but, it contains only abstract methods and fields which are final and static.In a separate class you need to implement this interface and provide body for all its abstract methods.Once you implement an interface using a class, you must provide body (implement) to ... Read More

Maruthi Krishna
900 Views
An interface in Java is similar to class but, it contains only abstract methods and fields which are final and static.You can implement multiple interfaces using a single class in Java. Whenever both interfaces have same name, since all the fields of an interface are static by default, you can ... Read More

Maruthi Krishna
2K+ Views
A method which does not have body is known as abstract method. It contains only method signature with a semi colon and, an abstract keyword before it.public abstract myMethod();Yes, you can throw and exception from an abstract class.ExampleIn the following Java program, we have a two classes: one abstract class ... Read More

Maruthi Krishna
2K+ Views
Yes, the abstract methods of an interface can throw an exception.ExampleIn the following example the interface (MyInterface) contains an abstract method with name display, which throws an IOException.import java.io.IOException; abstract interface MyInterface { public abstract void display()throws IOException ; }Rules to be followedYou need to follow the rules given ... Read More

Maruthi Krishna
558 Views
A checked exception is an exception that occurs at the compile time, these are also called as compile time exceptions. These exceptions cannot simply be ignored at the time of compilation; the programmer should take care of (handle) these exceptions.An unchecked exception is an exception that occurs at the time ... Read More

Maruthi Krishna
744 Views
While a superclass method throws an exception while overriding it you need to follow the certain rules.Should throw Same exception or, sub typeIf the super-class method throws certain exception, the method in the sub-class should throw the same exception or its sub type.ExampleIn the following example, the readFile() method of ... Read More

Maruthi Krishna
2K+ Views
In Java final is the access modifier which can be used with a filed class and a method.When a method if final it cannot be overridden.When a variable is final its value cannot be modified further.When a class is finale it cannot be extended.Declaring final variable without initializationIf you declare ... Read More