Objects are basic run-time entities in an object-oriented system.Objects takes space in memory and has an associated address. When program is executed objects interact by sending messages to one another.
For example customer and account are two objects in banking program, customer object may send the message to account object requesting for the balance. Objects are the combination of variables and methods.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | public class Bank { public void getBalance(String customer){ if(customer.equals("Java")){ System.out.println("BALANCE : "+100); } if(customer.equals("Pushkar")){ System.out.println("BALANCE : "+50); } } public static void main(String[] args) { Bank b = new Bank(); b.getBalance("Java"); } } |
Output:
BALANCE : 100
Blog Author - Pushkar Khosla,
Software Developer by Profession with 3.0 Yrs of Experience , through this blog i'am sharing my industrial Java Knowledge to entire world. For any question or query any one can comment below or mail me at pushkar.itsitm52@gmail.com.
This blog is all about to learn Core Java ,Interview Programs and Coding tricks to polish your Java Knowledge. If you like the content of this blog please share this with your friends.
Software Developer by Profession with 3.0 Yrs of Experience , through this blog i'am sharing my industrial Java Knowledge to entire world. For any question or query any one can comment below or mail me at pushkar.itsitm52@gmail.com.
This blog is all about to learn Core Java ,Interview Programs and Coding tricks to polish your Java Knowledge. If you like the content of this blog please share this with your friends.
Java I/O Tutorial

No comments:
Post a Comment