Submitted by heartin on Tue, 08/21/2012 - 04:26
We have discussed the theory about access modifiers in the previous note. This note will give you an example code that will show the valid and invalid usages for members belonging to different access levels from different regions of your code such as same class, subclass in same package, subclass in another package and a non-subclass in another package.
Submitted by heartin on Sat, 08/25/2012 - 01:18
Java doesn't allow operator overloading yet + is overloaded for class String. Here we will discuss examples for use of + with Strings and characters.
Submitted by heartin on Wed, 09/12/2012 - 03:43
Object-Oriented Programming (OOP) uses "objects" to model realworld objects. Object-Oriented Programming (OOP) consist of some important concepts namely Encapsulation, Polymorphism, Inheritance and Abstraction. These features are generally referred to as the OOPS concepts.
Submitted by heartin on Thu, 10/18/2012 - 11:28
In object oriented programming or in Unified Modelling, relationships between objects can be classified as association, aggregation, composition and inheritance.
Association is a relationship between two objects. Here objects might not be completely dependent on each other.
Submitted by heartin on Fri, 01/17/2014 - 20:03
Object-Oriented Development uses "objects" to model real world objects. A car or a laptop can be considered as object. While traditional programming views software as a collection of functions, an object oriented system concentrates on the objects that combines data and functionality together.
The traditional approach mostly focussed on structured system development and the technique used was usually referred to as the Structured Analysis and Design Technique (SADT).
Submitted by heartin on Tue, 04/08/2014 - 10:41
Let us quickly see object oriented analysis, object oriented design, object oriented implementation using a 'Library Management System' example.
Submitted by heartin on Mon, 09/14/2015 - 21:27
The ability to change form is known as polymorphism. Java supports different kinds of polymorphism like oveloading and overriding.
The same method name (method overloading) or operator symbol (operator overloading) can be used in different contexts.
In method overloading, multiple methods having same name can appear in a class, but with different signature. And based on the number and type of arguments we provide while calling the method, the correct method will be called.
Submitted by heartin on Mon, 09/14/2015 - 21:34
Inheritance describes the parent child relationship between two classes.
A class can get some of its characteristics from a parent class and then add more unique features of its own. For example, consider a Vehicle parent class and a child class Car. Vehicle class will have properties and functionalities common for all vehicles. Car will inherit those common properties from the Vehicle class and then add properties which are specific to a car.
Submitted by heartin on Mon, 09/14/2015 - 22:02
Encapsulation is the process of wrapping up of data (properties) and behavior (methods) of an object into a single unit; and the unit here is a Class (or interface). Encapsulate in plain English means to enclose or be enclosed in or as if in a capsule. In Java, everything is enclosed within a class or interface, unlike languages such as C and C++ where we can have global variables outside classes.