UrbanPro

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is use of interface in Java language?

Asked by Last Modified  

16 Answers

Learn Java

Follow 0
Answer

Please enter your answer

Expert in Java J2EE Training

Polymorphism is one of the key uses of inheritance. For ex, there are many implementations of List interface. Any implementation can be taken as a list object. List list = new ArrayList(), List list2 = new LinkedList etc., This goes to many levels.
Comments

Software Testing Trainer(Automation)

basically its correct to achieve multiple inheritance ,since its due to abstract method .we use interface to force to use already decided design pattern
Comments

IT Professional Trainer with 13 years of experience in IT industry + Academics

Java doesn't support multiple inheritance. In terms of interface you can implement that concept because You would be allowed to implement more than one interfaces in one class
Comments

Expert in Java/J2ee technology

In Java 1.8, Interface can contain the default body of a method which is called default method.
Comments

Trainer

Interface is used when There only abstract methods in the java interface not method body. It is used to achieve fully abstraction and multiple inheritance in Java.
Comments

More than 12 years of experience in IT Industry including Science/Computer teaching

Interface are used to code re-usability, and they are the real driver of ploymorphism in Java. Interface are also allows multiple inheritance in java.
Comments

16 Yrs of Experience in Teaching

It's like forcing to someone implement this task any how .. java does not support multiple inheritance , if i want to force by abstract class and also extends some other class it is not possible , so we can force it by interface we can also implement multiple interfaces at a time , interfaces have abstract...
read more
It's like forcing to someone implement this task any how .. java does not support multiple inheritance , if i want to force by abstract class and also extends some other class it is not possible , so we can force it by interface we can also implement multiple interfaces at a time , interfaces have abstract methods which must be implemented by extended class .... usually as a team leader of 15 employees i used to create interface to take surety that every class has same method name. read less
Comments

Experienced Software Professional

It is a contract or behaviour which a class that implements that interface must implement. Another use it that it lets Java programs implement "Multiple inheritance of TYPE" which is the ability to implement more than one interface.
Comments

Trainer

An interface in Java has remained a complex topic for many beginners to understand. The first thing which puzzles many programmers is the fact that you cannot define any method inside interface, it a just declaration. By rule, all method inside interface must be abstract (Well, this rule is changing...
read more
An interface in Java has remained a complex topic for many beginners to understand. The first thing which puzzles many programmers is the fact that you cannot define any method inside interface, it a just declaration. By rule, all method inside interface must be abstract (Well, this rule is changing in Java 8 to allow lambda expressions, now interface can have one non-abstract method, also known as a default method). So, if you can't define anything, Why we need an interface? what's the use of an interface, if we are anyway going to write a class and override them to provide behaviour, Can't we declare those methods inside the class itself without using interface etc. Well, if you are thinking in terms of behaviour then you are really missing the point of interface. read less
Comments

Trainer

As you know that Java does not allow multiple inheritance. Sometime in our real life we need to use multiple inheritance for example an amphibious animal inherits the behaviours of Aquatic and Terrestrial animals together, i.e. can walk on land as well as swim in water. To show the relationships in...
read more
As you know that Java does not allow multiple inheritance. Sometime in our real life we need to use multiple inheritance for example an amphibious animal inherits the behaviours of Aquatic and Terrestrial animals together, i.e. can walk on land as well as swim in water. To show the relationships in Java we can use Interface, which allows a class to implement more than one interface at a time. Moreover if we want to make all methods as abstract, we can use interface and provide the freedom to end developer to write own definitions for all methods in the implementing (concrete) class. read less
Comments

View 14 more Answers

Related Questions

What is the general syllabus covered in core Java training from any institution?
you can check the syallbus on http://felix-its.com/java-training-pune/
Shiv Kohli
0 0
5
How to use Java?
Basically JAVA is in two parts such as: Core JAVA. Advance JAVA and Frame works. What you want to learn Complete JAVA or Core part only.
Vinod
Is Java a pure object-oriented programming language?
Java language is not a Pure Object Oriented Language as it contain these properties: Primitive Data Type ex.
Shiv
0 0
5
Is synchronized keyword necessary, in Java, if everything that is modified in a function is local to that function?
No, it is not required if you make sure whatever parameters are updated/modified will be done as atomic references/operations. Atomicity is an alternative to syncronizatiom.
Abishiek
0 0
6

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

How to create Rest web services in Java
Web services are web application components that lets two different applications to communicate over the network.Let if an application which in written java provides web services can be communicated through...

Interview Tip : Q1) Why Strings are immutable in java ? What happen if it was mutable in java?
As we all know that Strings in java are immutabe in nature, now the question comes why the creator made it immutable in nature, although this field used maximum in any java program. The answer to this...

ClassNotFoundException vs NoClassDefFoundError
ClassNotFoundException NoClassDefFoundError It is an exception and happens due to programmer’s mistake and can be recovered by updating the code. Thrown when an application tries...

Introduction to Course Content
Video about what we are going to learn throughout the Java Training Session .

Inheritance In Java
Inheritance: The process of getting properties and behaviors from one class to another class is called inheritance. Properties: Variables Behaviors: Methods The main purpose of the inheritance...
D

Deleted U.

1 0
0

Recommended Articles

Before we start on the importance of learning JavaScript, let’s start with a short introduction on the topic. JavaScript is the most popular programming language in the world, precisely it is the language - for Computers, the Web, Servers, Smart Phone, Laptops, Mobiles, Tablets and more. And if you are a beginner or planning...

Read full article >

In the domain of Information Technology, there is always a lot to learn and implement. However, some technologies have a relatively higher demand than the rest of the others. So here are some popular IT courses for the present and upcoming future: Cloud Computing Cloud Computing is a computing technique which is used...

Read full article >

Java is the most famous programming language till date. 20 years is a big time for any programming language to survive and gain strength. Java has been proved to be one of the most reliable programming languages for networked computers. source:techcentral.com Java was developed to pertain over the Internet. Over...

Read full article >

Designed in a flexible and user-friendly demeanor, Java is the most commonly used programming language for the creation of web applications and platform. It allows developers to “write once, run anywhere” (WORA). It is general-purpose, a high-level programming language developed by Sun Microsystem. Initially known as an...

Read full article >

Looking for Java Training Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more