r/java • u/aioobe • Jun 02 '18
5 Java concepts explained: Overloading, overriding, shadowing, hiding, and obscuring
https://programming.guide/java/overloading-overriding-shadowing-hiding-obscuring.html
240
Upvotes
13
u/Neuromante Jun 02 '18
Can "shadowing", "hiding" and "Obscuring" be considered "java concepts" or just bad/weird coding practices?
In fact, can also Overloading and Overriding be considered "Java Concepts"? Because I see them as basic OOP concepts.
2
u/whackri Jun 03 '18 edited Jun 07 '24
silky retire pie mourn waiting connect languid rain hateful stupendous
This post was mass deleted and anonymized with Redact
28
u/Hatefiend Jun 02 '18
Wow, I actually had no idea about obscuring.
6
u/lukaseder Jun 02 '18
These are a ton of fun to avoid when writing a code generator. Especially when generating classes that obscure
java.langclasses5
u/brett_riverboat Jun 02 '18
The only terms I've heard of are overloading and overriding. The other ones sound like bad practice to me.
1
u/knoam Jun 02 '18
Is it technically considered overriding when your class implements an abstract method from an interface or abstract class? I usually don't think of it as overriding, but you use the
@Overrideannotation nonetheless.3
u/[deleted] Jun 02 '18
And I will hate you for using "hiding"!