Tính trừu tượng (Abstraction) trong Java

Tính trừu tượng (abstraction) là một trong bốn tính chất cơ bản của lập trình hướng đối tượng trong Java.

Tính trừu tượng là một tiến trình ẩn các chi tiết trình triển khai và chỉ hiển thị tính năng tới người dùng. Tính trừu tượng cho phép bạn loại bỏ tính chất phức tạp của đối tượng bằng cách chỉ đưa ra các thuộc tính và phương thức cần thiết của đối tượng trong lập trình.

Tính trừu tượng giúp bạn tập trung vào những cốt lõi cần thiết của đối tượng thay vì quan tâm đến cách nó thực hiện.

Trong Java, chúng là sử dụng abstract class và abstract interface để có tính trừu tượng. Chi tiết các bạn xem thêm ở bài viết: Abstract class và Interface trong Java.

Related posts:

Guide to the Synchronized Keyword in Java
Java Program to Implement Brent Cycle Algorithm
Java Program to Check Whether a Directed Graph Contains a Eulerian Path
Java Program to Check if a Matrix is Invertible
Java Program to Implement Hash Tables Chaining with Doubly Linked Lists
Java Program to Check Whether it is Weakly Connected or Strongly Connected for a Directed Graph
Java Program to Implement Sorted Singly Linked List
Removing all Nulls from a List in Java
Upload and Display Excel Files with Spring MVC
Spring – Injecting Collections
Java Program to Implement Sparse Matrix
Java Program to Implement the Schonhage-Strassen Algorithm for Multiplication of Two Numbers
Create a Custom Exception in Java
Map Serialization and Deserialization with Jackson
Java Program to Compute Discrete Fourier Transform Using the Fast Fourier Transform Approach
Java Program to Implement Red Black Tree
StringBuilder vs StringBuffer in Java
Java Program to Implement SynchronosQueue API
Custom HTTP Header with the HttpClient
Hashing a Password in Java
ThreadPoolTaskExecutor corePoolSize vs. maxPoolSize
HashMap trong Java hoạt động như thế nào?
REST Web service: HTTP Status Code và xử lý ngoại lệ RESTful web service với Jersey 2.x
Java Program to Implement Hamiltonian Cycle Algorithm
Functional Interface trong Java 8
Spring REST with a Zuul Proxy
Java Program to Implement Disjoint Sets
Java Program to Implement PriorityQueue API
Dynamic Proxies in Java
Java Program to Implement PriorityBlockingQueue API
How to Get All Spring-Managed Beans?
Immutable ArrayList in Java