Some clarification with Java OOP theory?

SimpleJack

So I'm quite new to OOP and Java in general. I've been going through my textbook on the 4 most fundamental concepts of OOP programming but it's quite confusing.

The textbooks states "A class can change its functioning or variable type and the user would not need to change their code" as an advantage of Encapsulation, but to me that sounds like Abstraction...

Also, the textbook lists Overriding and Overloading as forms of inheritance but Google is telling that Overriding and Overloading are forms of Polymorphism.

Can someone clear this up for me?

Marko Topolnik
  1. You are fully right that it is abstraction which allows the implementation to change without affecting its user. However, encapsulation is a key feature in building bullet-proof abstractions: without it a user of your object stays independent of implementation only if he follows the convention never to access internal state of the object.

  2. Overloading has definitely, positively, nothing to do with inheritance. It is a (weak) kind of polymorphism, but most of all, it is just an allowance to use the same name for several completely distinct methods. It has next to nothing to do with OOP and is fully applicable to any other programming paradigm, such as procedural or functional.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

clarification on using OutputStream in Java?

From Dev

What is mean by creating some object will be expensive in java/oop

From Dev

Abstraction clarification. Java

From Dev

Need some clarification on #pragma once

From Dev

MVC - the web and some clarification

From Dev

Need some clarification regarding reference types

From Dev

Initializing static class members - some clarification please

From Dev

Clarification on C# OOP

From Dev

Java Interface Clarification

From Dev

Clarification regarding threads in Java

From Dev

Java is clearly a pass by value but wanted some clarification

From Dev

Java ListIterator clarification

From Dev

Some clarification on numpy indexing needed?

From Dev

Clarification about overriding in Java

From Dev

Java left shift clarification

From Dev

Java HttpResponse clarification

From Dev

request clarification on appearance of apparent real coercion in theory involving natural numbers in Isabelle theory

From Dev

Java dynamism clarification

From Dev

Clarification in Java Package structure

From Dev

MVC - the web and some clarification

From Dev

Clarification on String concatenation in java

From Dev

I need some clarification on some code samples

From Dev

Prototype and obj some clarification

From Dev

Java class instantiation clarification

From Dev

Java - Working with IO - Clarification

From Dev

Java ListIterator clarification

From Dev

I need some clarification on Java while loop

From Dev

Future related clarification in Java

From Dev

Clarification on Java Serialization