So, I have been reading few random things about Java here and there. It was a bit disorgansed and hence no post for quite some time. Basically , I studied very basics like
— data types,
— general syntax for control flow statements
— Mathematical and logical operators
It was a kind of revision, not very interesting one!
When it comes to learning Java or even talking about Java, one can’t go on for long without talking about OOP or Object Oriented Programming. Hence, I did a fair bit of reading about “Why OOP??”
Will just write about in bullet points to make it easy to read!
— Everything was a function in this style of programming.
— Problem to be coded is broken down into functions/ routines.
— Functions are the building blocks and data does not have an owner.
— Function and data are decoupled.
— Anything (function) can be called by anything (another function)
— Limited Restriction : which is mainly governed by scope of variables.
— No automatic resource deallocation
— Hard to maintain.
— Examples: C, PASCAL, BASIC, COBOL
Object Oriented Programming
— Data/attributes and Methods/functions are tightly coupled.Data is more important !
— Object comprises of data and methods.
— Everything is an object!
— Program comprises of objects which communicate with each other.
— Easy to maintain.
— Enables reusability, hence saves time.
— Information hiding more powerful.
— Example: Java