Hi ! I’m Ogata.
Today, I show you how we can use interface of Java.
Java is programming language. It’s very major.
Plus, it’s OOP language.
OOP is the Object Oriented Programming.
And so, today, I show you interface power of reuse points.
Look at this script.
This is very easy script. The constructor is used GetCar class.
If you don’t know constructor, you study it by another book.
Points are two.
To call constructor is in main method, and numbers of 2, 1 are used.
However, at printline call, just used it with carSize.getFoo().
The carSize is variable. The getFoo method is interface’s abstract method name.
If you want to call this method of the other implemented class, You use this by the same name.
For example, carVolume.getFoo().
This is same pattern and the same how to write.
This is power of Interface of Java.
You know about it?
It’s incredible things.
Since I notice this, I’m very moved by Java programming.
How about it?
This is it. That’s time now.
If you awake this power, I’m very pleasant.
Comments
Post a Comment