Closed Just-some-one closed 3 months ago
would not be better to add extra line
myAnimal.testClassMethod();
to explain that the static method that get called is depend on the variable type not the actual object type and giving a note that it bad practice to call static method using an instance but doing that just to show how things works
I don't think it's a good idea to show bad practices unless there's significant benefit (even when explaining it's a bad practice). In my opinion, it's sufficient to show people how to use the good practices.
it missing the link to the playingCard and StandardDeck implementations which exist on the old tutorial site https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html
I don't know about linking to off-site code for the tutorials. I guess it might be better to either include the necessary parts of the code inside the article, rewrite it in a way that makes it clear it would be a class to be created or just leave it as-is.
Done, thank you for your reports!
thanks for both of you :)
for the static method on the override tutorial
for that code
would not be better to add extra line
myAnimal.testClassMethod();
to explain that the static method that get called is depend on the variable type not the actual object type and giving a note that it bad practice to call static method using an instance but doing that just to show how things works
another point on the first section of that page to add link to the annotation tutorial on that paragraph
https://dev.java/learn/annotations/
for https://dev.java/learn/inheritance/objects/#finalize
adding link to the I/O tutorial would be nice
for https://dev.java/learn/inheritance/abstract-classes/
a link to the interface tutorial would be nice
now for the interface tutorial
for the interface tutorial
also interface can have private instance method but only with body
and
we could add private method to it also
for static method on interface
it sound like that refactor piece of code from the static method will be in private method but it compile time error to call instance method from static context
for integrating default method part
it missing the link to the playingCard and StandardDeck implementations which exist on the old tutorial site https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html
https://docs.oracle.com/javase/tutorial/java/IandI/examples/defaultmethods/PlayingCard.java
https://docs.oracle.com/javase/tutorial/java/IandI/examples/defaultmethods/StandardDeck.java
for generic
dest need to be wrapped by code tag to get the required color
sorry for long post and have a nice day :)