谁能简单地向我解释一下在哪里使用接口,继承和抽象方法?有实时的例子 [英] Can anyone briefly explain me about where to use interface, inheritance and abstract methods? With realtime examples

查看:51
本文介绍了谁能简单地向我解释一下在哪里使用接口,继承和抽象方法?有实时的例子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直怀疑,在接口中我们只提供将在其他类/ es中实现的签名,这里我的问题是提供此签名的用途是什么,而不是在另一个类中完成的实现? ?

为什么我们不想在没有接口的情况下编写实现?

用java语言解释我............ >


我尝试了什么:



i不知道究竟如何使用界面,继承和抽象类

I have a doubt all the time , in interface we just provide the signature that will be implemented in some other class/es, here my question is what will be the use of providing this signature rather the implementation done at another class??
why shouldn't write the implementation without interface wherever we want??
explain me in java language...........

What I have tried:

i don't know exactly how to use interface, inheritance and abstract classes

推荐答案

请参阅 Java教程 [ ^ ]。您也可以使用Google进行自己的搜索。
See The Java Tutorials[^]. You could also do your own searching with Google.


在一个小文本框中,您希望我们在阅读您的教科书后解释您不理解的复杂科目?不可能或不可行 - 我们不能写出比没有图片的有限格式更好的东西,让你运行示例,等等。

相反,从Google开始:< a href =https://www.google.co.uk/search?q=interface%2C+inheritance+and+abstract+classes&oq=interface%2C+inheritance+and+abstract+classes&aqs=chrome。 .69i57& sourceid = chrome& ie = UTF-8#safe = off& q = interface%2C + inheritance + and + abstract + classes + java> interface,inheritance and abstract classes - Google Search [ ^ ]并按照一些链接。它们应该包含足够多的内容来详细解释这个主题。

你可以把作为家庭作业的例子交给他们吗?你应该自己写一下......
In a little text box you want us to explain complicated subjects that you don't understand after reading your text books? Not really possible, or viable - we can't write anything better than they do in such a limited format without pictures, getting you to run examples, and so forth.
Instead, start with Google: interface, inheritance and abstract classes - Google Search[^] and follow a few of the links. They should contain more than enough to explain the subject in good detail.
And the examples you can hand in as your homework? You are supposed to write them yourself...


这篇关于谁能简单地向我解释一下在哪里使用接口,继承和抽象方法?有实时的例子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆