Abstraction is the process of hiding the details and exposing only the essential features of a particular concept or object. Computer scientists use abstraction to understand and solve problems and communicate their solutions with the computer in some particular computer language. We illustrate this process by way of trying to solve the following problem using a computer language called Java.
Problem: Given a rectangle 4.5 ft wide and 7.2 ft high, compute its area.
We know the area of a rectangle is its width times its height. So all we have to do to solve the above problem is to multiply 4.5 by 7.2 and get the answer. The question is how to express the above solution in Java, so that the computer can perform the computation.
- 瀏覽次數:1420