DevOps Articles

Curated articles, resources, tips and trends from the DevOps World.

OOP Concept for Beginners: What is Abstraction?

2 years ago stackify.com
OOP Concept for Beginners: What is Abstraction?

Summary: This is a summary of an article originally published by Stackify. Read the full original article here →

Abstraction is one of the https://stackify.com/oops-concepts-in-java/ of object-oriented programming (OOP) languages. That’s a very generic concept that’s not limited to object-oriented programming.

In this case, the hazelnut coffee bean itself is an abstraction of the original data, the raw coffee beans.

import org.thoughts.on.java.coffee.CoffeeException; import java.utils.Map; public class CoffeeMachine { private Map beans; public CoffeeMachine(Map beans) { this.beans = beans } public Coffee brewCoffee(CoffeeSelection selection) throws CoffeeException { Coffee coffee = new Coffee(); System.out.println(“Making coffee...”); return coffee; }}

public class Grinder { public GroundCoffee grind(CoffeeBean coffeeBean, double quantityCoffee) { //... }} public class BrewingUnit { public Coffee brew(CoffeeSelection selection, GroundCoffee groundCoffee, double quantity) { //... }}

Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com