Java Interface Simple Example

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

@pr0master
Interface make it more formal for classes. if a class implements some interface it commits to have certain behaviors (methods) that it promises to provide. and sure you can still make two methods without using any interface. it just matters with a big project with tons of classes.

minhsoncse
Автор

>.< i still dont know what it does or what you would use it for

pianoman
Автор

if all it does is say hello world cant you just so something like Class.Function();
to call the function instead of all that

pianoman
Автор

I find it hard to understand. Why use a interface? You could make two methods without a interface.

prmaster
Автор

no need to have interface for that program...

gatoo
Автор

@minhsoncse
Never though about it like that. I thank you for you explanation.

prmaster