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

Should we learn DBMS and RDBMS without any Java training?
java or i can say any programming language is not required to learn DBMS or RDBMS
Karthik
0 0
6
Tell me how to register for java training in summer in niit chandigarh.
Hello Sumit, Its nice to learn java based on your timings. We are providing real-time training to students from USA. Generally we used to start sessions at nights according to Indian timings, and it would...
Vishakha
will I get certificate
Better than certificate if you enroll with me you will get confidence and lot of practical knowledge...certifications dont matter after a period of time what really matters is your approach to a problem...
Sk.
Is it possible to learn java at home without coaching in one month?
It all depends on you. If you are already aware of programming then it is definetly possible to learn java at home. But if learn through a tutor then you can learn easily.
Pritom
0 0
5

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

Ask a Question

Related Lessons

A Tip for the beginners.
The world of programming languages right now is too dense, and too big for any beginner. But at the same time, because of so many options available, it's easier too. You can start with any language that...

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

Java Collection
Collection: The collection provides an architecture like a list where we can store and manipulate the group of items. Through Collections, we can achieve operations such as searching, sorting, insertion,...

How 4 byte float can store 8 byte long values in java ?
long l = 12464545L; float f = l; (fine) int i = l ; (Error) if we see the how this magic happens as we know the answer lies in the floating point representation as in floating points values does not...

jOOQ 3.10 Supports JPA Attribute Converter
One of the cooler hidden features in jOOQ is the JPADatabase, which allows for reverse engineering a pre-existing set of JPA-annotated entities to generate jOOQ code. For instance, you could write these...

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