Abstraction Program in Java
Advertisements
Abstraction Example in Java
Abstraction is the concept of hiding of data is known as data abstraction. Here we write code for data abstraction using java programming.
Abstraction Example in Java
class Customer { int account_no; float balance_Amt; String name; int age; String address; void balance_inquiry() { /* to perform balance inquiry only account number is required that means remaining properties are hidden for balance inquiry method */ } void fund_Transfer() { /* To transfer the fund account number and balance is required and remaining properties are hidden for fund transfer method */ }
Output
Syntax to compile and run java program
Syntax
for compile -> c:/>javac Customer.java for run -> c:/>java Customer
For more derails about Inheritance in Java
Google Advertisment