-
WEB DEVELOPMENT
HTML5 | PHP | FLASH | DRUPAL | JOOMLA | LAMP | MAGENTO | WPF | APACHE | Wordpress...
-
POST WITH SOFTWARE CLOUD
JAVA | C++ | ASP.NET | VISUAL BASIC.NET | PYTHON | PHP | C## | COFFY SCRIPT...
-
POST WITH OOP CONCEPT FEATURES
Inheritance --|-- Encapsulation --|-- Poymorephism --|-- Abstraction
-
ANDROID DEVELOPMENT
Android Activities | User Interfaces | Application Model | Maps and LBS | Databases and Content provider | Graphics and Animation | Media and Telephony...
-
DADABASE DEVELOPMENT
MYSQL | MYSQL Server | PHP MyAdmin | SQL ite | Sky SQL | ORACAL | TEBIRO | SyBase...
-
MOBILE APPLICATION DEVELOPMENT
Design and Develop User Interface | Develop and Design of Software | Application Porting | Certificate of Application | Testing of Multiplae Design...
-
ARDUINO PROJECT DEVELOPMENT
Blink| Arduino 1.0 Develop and Design of Software...
-
ARTIFICIAL INTELLIGENCE ROBOT DEVELPOMENT
Electronic Component Total Solution Based On Mecharronics Technology and Total Control System technology...
-
NETWORKING TECHNOLOGY
Cisco | Extreme Network | Glue Network | Network Utility Force | Bigswich Network | Networking Spacer | EvenScope | Wifier Network | Cloud satack Network...

Simple
1. My First Java Program: Print a Message "Hello World"
2. Java program to swap two numbers
3. Java program to swap two numbers without using temp variable
4. Java program to convert given number of days into months and days
Loops
1. Java program to check whether a number is prime or not
2. Java program to find sum of digits of a number
3. Java program to find whether a number is armstrong or not
4. Java program to display multiplication table of any number
5. Java program to check whether a given number is palindrome or not
6. Java program to find factorial of given number
7. Java program to reverse a given number
8. Java program to print fibonacci series
Array
1. Java Program to Find Smallest and Largest Element in an Array
2. Java Program to Find Union of two Arrays
3. Java Program for Addition of two Matrices
4. Java Program for Multiplication of two Matrices
Sum of Series

2. Java program to swap two numbers
3. Java program to swap two numbers without using temp variable
4. Java program to convert given number of days into months and days
Loops
1. Java program to check whether a number is prime or not2. Java program to find sum of digits of a number
3. Java program to find whether a number is armstrong or not
4. Java program to display multiplication table of any number
5. Java program to check whether a given number is palindrome or not
6. Java program to find factorial of given number
7. Java program to reverse a given number
8. Java program to print fibonacci series
Array
2. Java Program to Find Union of two Arrays
3. Java Program for Addition of two Matrices
4. Java Program for Multiplication of two Matrices
Sum of Series
Read More »
Object Oriented Programming With C++ 4th Edition By E Balaguruswamy Free eBook Download
12:06 PM 1 comments
Hello Everyone, today I am going to share about a book that helped me a lot in learning C++ programming. So the name of book is Object Oriented Programming With C++ which is written by E Balaguruswamy. He has written many other popular books about programming languages like C and Java. Actually I have started my programming journey from this book and I highly recommend beginners to start learning from it.
Turbo C++ for Windows 7 32/64 bit - Download and Install
Hello everyone, after a long time I am once again here to share something with you. Actually in one of my previous article I have given a link to download turbo c++ for Windows 7. But i think that most of us use windows 8 and that will not work in full screen mode in windows 8. So to solve this problem I am sharing another link in this article to download turbo c++ for windows 8 32/64 bit for absolutely free. This compiler is already enabled with DosBox. It will also work in windows 8 and Mac OS also.Please download and share your experience of using turbo c++ for windows 8 by commenting below.
turbo c for windows 8
turbo c++ for windows 8 64 bit
turbo c for windows 7 32 bit
turbo c for windows xp
turbo c setup for windows 7
Read More »

OOPs Basics
----------------------------------
a) Data
b) Instructions for processing that data
into a self-sufficient ‘object’ that can be used within a program or in other programs.
Advantage of Object Oriented Programming
b) This enables modeling complex systems of real world into manageable software solutions.
Programming techniques
b) Procedural Programming (Assembly language, C programming)
c) Object Oriented Programming (C++, Java, Smalltalk, C#, Objective C)
a) The data is global and code operates on it
b) As the size of code increases, maintenance is a problem
c) Does not have independent data for processing
d) The concept of local variables did not exist
e) Reusability of code was not supported
2. Variables
a) The variables that are declared outside any function body.
b) These variables exist for the entire life-cycle of the program.
c) Global variables can be accessed from anywhere within the program.
a) The variables that are declared within a function body.
b) Their scope is limited to within the function body.
c) Local variables cannot be accessed outside the function body.
Object Oriented Programming
Object: is a bundle of related variables and functions (also known methods).
State: State is a well defined condition of an item. A state captures the relevant aspects of an object
Behavior: Behavior is the observable effects of an operation or event,
eg 1:
Object: House
State: Current Location, Color, Area of House etc
Behavior: Close/Open main door.
Object: – Car
State: Color, Make
Behavior: Climb Uphill, Accelerate, SlowDown etc
- Abstraction
- Encapsulation
- Message passing
Message passing
One object invoking methods on another object is known as Message passing.
It is also referred to as Method Invocation.
Class
An object is created when a class is instantiated
ClassName Objectname;
Memory space is allocated only when a class is instantiated i.e. when an object is created
E.g.
GraduationCourse mycourse= new GraduationCourse();Abstraction
Note 1: Abstraction is used to build complex systems.
Key to simplify a complex design into smaller, manageable parts which then become the components of a bigger and complex system.
The idea of hiding the complexity within a smaller/simple component of a system.
Note 2: Abstraction is not a feature of Object oriented concepts alone. Even in procedural language programming, abstraction can be achieved to a limited extent by hiding complex internals through well formed business logic and functions.
Encapsulation
Encapsulation is also called as “Information Hiding”.
1) Objects encapsulate data and implementation details. To the outside world, an object is a black box that exhibits a certain behavior.
2) The behavior of this object is what which is useful for the external world or other objects.
3) An object exposes its behavior by means of methods or functions.
4) The set of functions an object exposes to other objects or external world acts as the interface of the object.
1) The functionality where in we can change the implementation code without breaking the code of others who use our code is the biggest benefit of Encapsulation.
2) Here in encapsulation we hide the implementation details behind a public programming interface. By interface, we mean the set of accessible methods our code makes available for other code to call—in other words, our code’s API.
3) By hiding implementation details, We can rework on our method code at a later point of time, each time we change out implementation this should not affect the code which has a reference to our code, as our API still remains the same
1) Make the instance variables protected.
2) Create public accessor methods and use these methods from within the calling code.
3) Use the JavaBeans naming convention of getter and setter.
Eg: getPropertyName, setPropertyName.
class EmployeeCount { private int NoOfEmployees = 0; public void setNoOfEmployees (int count) { NoOfEmployees = count; } public double getNoOfEmployees () { return NoOfEmployees; } } class Encapsulation { public static void main(String args[]) { System.out.println("Starting EmployeeCount..."); EmployeeCount employeeCount = new EmployeeCount (); employeeCount. setNoOfEmployees (12003); System.out.println("NoOfEmployees = " + employeeCount. getNoOfEmployees ()); } }
The application using an Object of this class EmployeeCount will not able to get the NoOfEmployees directly.
Setting and getting the value of the field NoOfEmployees is done with the help of Getter and setter method as shown below.
Inheritance
- Inheritance is a mechanism of defining a new class based on an existing class.
- Inheritance enables reuse of code. Inheritance also provides scope for refinement of the existing class. Inheritance helps in specialization
- The existing (or original) class is called the base class or super class or parent class.The new class which inherits from the base class is called the derived class or sub classor child class.
- Inheritance implements the “Is-A” or “Kind Of/ Has-A” relationship.
The member variables and methods of the base class can be used in the derived class as well.
Consider below two classes –
class Teacher { private String name; private double salary; private String subject; public Teacher (String tname) { name = tname; } public String getName() { return name; } private double getSalary() { return salary; } private String getSubject() { return subject; } }
class OfficeStaff{ private String name; private double salary; private String dept; public OfficeStaff (String sname) { name = sname; } public String getName() { return name; } private double getSalary() { return salary; } private String getDept () { return dept; } }
1) Both the classes share few common properties and methods. Thus repetition of code.
2) Creating a class which contains the common methods and properties.
3) The classes
Teacher and OfficeStaff can inherit the all the common properties and methods from below Employee classclass Employee{ private String name; private double salary; public Employee(String ename){ name=ename; } public String getName(){ return name; } private double getSalary(){ return salary; } }
5) Any similar classes like Engineer, Principal can be generated as subclasses from the Employee class.
6) The parent class is termed super class and the inherited class is the sub class
7) A sub class is the specialized version of a super class – It inherits all of the instance variables and methods defined by the super class and adds its own, unique elements.
8) Although a sub class includes all of the members of its super class it can not access those members of the super class that have been declared as private.
9) A reference variable of a super class can be assigned to a reference to any sub class derived from that super class
i.e.
Employee emp = new Teacher();Multilevel Inheritance
Multilevel inheritance refers to a mechanism in OO technology where one can inherit from a derived class, thereby making this derived class the base class for the new class.
Multiple Inheritance
“Multiple Inheritance” refers to the concept of one class inheriting from more than one base class. The inheritance we learnt earlier had the concept of one base class or parent. The problem with “multiple inheritance” is that the derived class will have to manage the dependency on two base classes.
Note 1: Multiple Inheritance is very rarely used in software projects. Using Multiple inheritance often leads to problems in the hierarchy. This results in unwanted complexity when further extending the class.
Note 2: Most of the new OO languages like Small Talk, Java, C# do not support Multiple inheritance. Multiple Inheritance is supported in C++.
Polymorphism
1) Static Polymorphism
2) Dynamic Polymorphism
Function Overloading – within same class more than one method having same name but differing in signature.
Resolved during compilation time.
Return type is not part of method signature.
Function Overriding – keeping the signature and return type same, method in the base class is redefined in the derived class.
Resolved during run time.
Which method to be invoked is decided by the object that the reference points to and not by the type of the reference.
Redefining a super class method in a sub class is called method overriding.
The method signature ie. method name, parameter list and return type have to match exactly.
The overridden method can widen the accessibility but not narrow it, ie if it is private in the base class, the child class can make it public but not vice versa.
Consider a Super Class Doctor and Subclass Surgeon. Class
Doctor has a methodtreatPatient(). Surgeon overrides treatPatient method ie gives a new definition to the method.Doctor doctorObj = new Doctor(); // Call the treatPatient method of Doctor class doctorObj.treatPatient() Surgeon surgeonObj = new Surgeon(); // Call the treatPatient method of Surgeon class surgeonObj.treatPatient() Doctor obj = new Surgeon(); // calls Surgeon’s treatPatient method as the reference is pointing to Surgeon obj.treatPatient();
Method Overloading refers to the practice of using the same name to denote several different operations. Overloading can be done for both functions as well as operators. Here we look at only Method overloading.
Declaration:
void SomeMethod (int value); void SomeMethod (float value); void SomeMethod (char value); void SomeMethod (String* str); void SomeMethod (char* str);
1) In Overloading we can reuse the same method name by changing the arguments.
2) Overloaded methods- Must and Must Not Facts:
- The Overloaded method must have different argument lists,
- Can have different return types but in that case it is mandatory to have different argument list.
- Can have different access modifiers and
- Can throw different exceptions
A: Object type
Q: What determines which overloaded method will be used at compile time?
A: Reference type determines. Operator overloading refers to the operators like ‘+’ being used for different purposes based on the data type on either side of the operator.
Combined example for Inheritance & Polymorphism
abstract public class Employee { private String name; public Employee(String ename) { name = ename; } public String getName() { return new name; } private void setName(String name) { this.name = new String(name); } abstract public double pay(); public String toString() { return "name is" + name; } } public class Salaried extends Employee { double salary; public Salaried(String name, double s) { super(name); salary =s; } public void setSalary(double salary) { this.salary = salary; } public double getSalary() { return salary; } public double pay() { return salary; } public String toString(){ return super.toString() + " (salary is " +salary+")"; } }
IS-A & HAS-A Relationships
public class SuperClass { … } public class SubClass1 extends SuperClass { //SubClass 1 code goes here } public class SubClass2 extends SubClass1 { //SubClass2 Specific code goes here }
A Car IS-A Vehicle. A Car HAS-A License. and the code looks like this:
public class Vehicle{ } public class Car extends Vehicle{ private License myCarLicense; }
Interfaces
- Java does not support Multiple Inheritance
- Interface is similar to an abstract class that contains only abstract methods
- Declared with the keyword interface instead of the keyword class
- Keyword implements is used to represent the interfaces implemented by the class
class ClassName extends Superclass implements Interface1, Interface2, ....
All methods in an interface are implicitly public and abstract.The keyword abstract before each method is optional.An interface may contain definitions of final variables.A class may extend only one other class, but it may implement any number of interfaces.
1) A method that is declared but not defined
2) Declared with the keyword abstract
3) Example :
abstract public void playInstrument();
5) Used to put some kind of compulsion on the class who inherits from this class. i.e., the class who inherits MUST provide the implementation of the method else the subclass will also become abstract
6) The following cannot be marked with “abstract” modifier
- Constructors
- Static methods
- Private methods
- Methods marked with “final” modifier
Abstract Classes
Outlines the behavior but not necessarily implements all of its behavior. Also known as Abstract Base Class.
Provides outline for behavior by means of method (abstract methods) signatures without an implementation.
A class derived from the abstract base class must implement those member functions which are not implemented in the abstract class.
To use an abstract class one has to first derive another class from this abstract class using inheritance and then provide the implementation for the abstract methods.
Note 3: If a derived class does not implement all the abstract methods (unimplemented methods), then the derived class is also abstract in nature and cannot be instantiated.
abstract class Costume { abstract public void Stitch(); public void setColour (){ //code to set colour } }
What is a Constructor
2) It does not return a value not even void
3) It may or may not have parameters (arguments)
4) A class contains one or more constructors for making new objects of that class
5) If (and only if) the programmer does not write a constructor, Java provides a default constructor with no arguments.
- numeric types are set to zero
- boolean variables are set to false
- char variables are set to ‘’
- object variables are set to null.
It implicitly call the default constructor of it’s super class Or can make this constructor call explicitly, with super(…);
In order to implement the concept of inheritance in an OO solution, one has to first identify the similarities among different classes so as to come up with the base class.
Access Specifiers
An access specifier is a keyword in OO Programming languages, which specify what access is permitted on a member.
There are three types of access specifiers:
public: Accessible to all. Other objects can also access this member variable or function.
private: Not accessible by other objects. Private members can be accessed only by the methods in the same class. Object accessible only in Class in which they are declared.
protected: The scope of a protected variable is within the class which declares it and in the class which inherits from the class (Scope is Class and subclass)
Default: Scope is Package Level
Step 1. Identify all the classes (Nouns; Type of objects) in the requirement specification,
Step 2. Identify the commonalities between all or small groups of classes identified (generalization) if it is obvious. Do not force fit generalization where it doesn’t make sense.
Step 3. In any given situation, start with the simplest object which can be abstracted into individual classes
Step 4. Identify all the member variables and methods the class should have
Step 5. Ensure that the class is fully independent of other classes and contains all the attributes and methods necessary.
Step 6. Keep all the data members private or protected
Step 7. The methods in the class should completely abstract the functionality
Step 8. The methods in the class should not be a force fit of procedural code into a class
Step 9. Inherit and extend classes from the base classes ONLY IF the situation has scope for it
Step 10. Define the relationships among the classes (“Has-A”, “Uses-A”)
Step 11. Keep the number of classes in your application under check (do not create any unnecessary classes).
Read More »
.jpg)


