Monday 19 August 2013

OOPS Concept With Real Life Example

OOPS Concept With Real Life Example

This is the most asked Question in a technical interview in any domain.. OOPS Concept is very very important.. Today I will explain OOPS concept with real Life Example that will help you to grasp the concept well and excel in the interviews...

Objects: Object is the basic unit of object-oriented programming.Objects are identified by its unique name. An objectrepresents a particular instance of a class. There can be more than one instance of an object. Each instance of an object can hold its own relevant data.

An Object is a collection of data members and associated member functions also known as methods.

Classes: Classes are data types based on which objects are created.Objects with similar properties and methods are grouped together to form a Class. Thus a Class represent a set of individual objects. Characteristics of an object are represented in a class as Properties. The actions that can be performed by objects becomes functions of the class and is referred to as Methods.

Example #1:

For example consider we have a Class of Cars under which Santro Xing, Alto and WaganR represents individual Objects.In this context each Car Object will have its own, Model,Year of Manufacture, Colour, Top Speed, Engine Power etc.,which form Properties of the Car class and the associated actions i.e., object functions like Start, Move, Stop form the Methods of Car Class.No memory is allocated when a class is created. Memory is
allocated only when an object is created, i.e., when an instance of a class is created.

Example #2:

An architect will have the blueprints for a house....those blueprints will be plans that explain exactly what properties the house will have and how they are all layed out.  However it is just the blueprint, you can't live in it.  Builders will look at the blueprints and use those blueprints to make a physical house.  They can use the same blueprint to make as many houses as they want....each house will have the same layout and properties.  Each house can accommodate it's own families...so one house might have the Smiths live in it, one house might have the Jones live in it.

The blueprint is the class...the house is the object.  The people living in the house are data stored in the object's properties.

Abstraction: Abstraction means showing essential features and hiding non-essential features to the user.

For Eg.  Yahoo Mail...

When you provide the user name and password and click on submit button..It will show Compose,Inbox,Outbox,Sentmails...so and so when you click on compose it will open...but user doesn't
know what are the actions performed internally....It just Opens....that is essential; User doesn't know internal actions ...that is non-essential things...

For Eg. Tv Remote..
Remote is a interface between user and tv..right. which has buttons like 0 to 10 ,on /of etc but we dont know circuits inside remote...User does not  need to know..Just he is using essential thing that is remote.
 
Encapsulation: Encapsulation means which binds the data and code (or) writing operations and methods in single unit (class).
 
For Example:
A car is having multiple parts..like steering,wheels,engine...etc..which binds together to form a single object that is car. So, Here multiple parts of cars encapsulates itself together to form a single object that is Car.

In real time we are using Encapsulation for security purpose...

Encapsulation = Abstraction + Data Hiding.


Inheritance: Deriving a new class from the existing class,is called Inheritance.
Derived(sub class) class is getting all the features from Existing (super class\base class) class and also incorporating some new features to the sub class.

For Eg.,

class Address
{
String name;
Srting H.no;
String Street name;
}
class LatestAddress extends Address
{
String City;
String State;
String Country;
}
public class Sumit
{
{
LatestAddress la = new LatestAddress();
//Assign variable accordingly...
}
}

In the above Example class LatestAddress getting all features from the Address class.
In the LatestAddress class we have total 6 properties..3 are inherited from Address class and 3 properties are
incorporated. So In the class Sumit we are declaring the object of class LatestAddress and then assign new variables using the properties of the previous base classes... So this is a nice example of inheritance..

Polymorphism :

Polymorphism means ability to take more than one form that an operation can exhibit different behavior at different instance depend upon the data passed in the operation.

1>We behave differently in front of elders, and friends. A single person is behaving differently at different time.

2> A software engineer can perform different task at different instance of time depending on the task assigned  to him .He can done coding , testing , analysis and designing depending on the task assign and the requirement.

3> Consider the stadium of common wealth games. Single stadium but it perform multiple task like swimming, lawn tennis etc.

4> If a girl is married and mother of 2 children doing teaching job then  she is a women first ,, teacher in a school when she is in school,,wife of someone at home,, mother of her children,, and obvious daughter of someone & may be girl friend of someone (just kidding) means a woman plays diffent roles at different times dats the polymorphism (many forms).

Summary:

OOPs have following features:

1. Object             - Instance of Class
2. Class               - Blue print of Object
3. Encapsulation    - Protecting our Data
4. Polymorphism   - Different behaviors at different instances
5. Abstraction        - Hiding our irrelevant Data
6. Inheritence        - One property of object is acquiring to another property of object

Thursday 15 August 2013

Oracle 10g Installation

Installation of Oracle 10g 
on windows 7 (32-bit or 64-bit):



Normally it gives error while installing (oracle 10g for windows) on windows 7..

-> In this blog I will show you how to install......just follow me to to handle errors and install it successfully.

go to location where you downloaded oracle 10g setup for windows.

.Right click on setup and run as a administrator then first wizard will come like  this-


.choose path where you want to install (don't choose path inside OS drive, it's advisable not mandatory)-

.Create your password and confirm it.

Now click on next button. Some times it will get success. If it's success then good but if you are getting below mentioned wizard after clicking next button:


then no need to worry about this. just go to your setup location.

->Right click on setup and go for properties.

-> Select Compatibility and mark compatibility mode then  pop-up option          will  enable.

-> Scroll down pop-up options and select windows xp service pack 2.

Again follow same process to to setup and run as a Administrator.

This time your setup will continue without giving any error and second wizard of installation will show like this:



If you want to create default data base at the time of installation itself then select first option and click on next button.

In next step specify home details and click on next.

-> Then in next wizard of installation:



 it will give you some errors so just click on OK on warning wizards.

-> click on next buttons till below wizard(Specify Database Schema Wizard):



->Create passwords for user accounts. (e.g. SYS, SYSTEM etc.)

->Click on next button then it will ask for access so simply allow access.

Now you will able to see main wizard of installation like below:




->Click on install button. now installation will start and Configuration                Assistants will get succeed. Please note during this one another wizard will come for password management of users.

-> So According to your need select next step even you can click on OK or you can go for password management.

-> After completion of password management your installation will get over        with in a seconds and you will get last wizard like this:



ENJOY FRIENDS
  
Keep visit my blog for more technical solutions.














Wednesday 14 August 2013

Simplest way to install Windows 7 with iso file

                                            The S!mple$t w@y to 
                              !nstall Window$ 7
                                        

 Firstly go to blow link and download windows 7 iso image as per your system requirement (32-bit or 64-bit)   :                                                                                                                                                                          Link to download windows 7 iso image 

                                         
After successful downloading (it may take a while because it's size is near about 2.3 GB), you will need to one more software in order to install iso image of windows 7 in your system. so please visit below mentioned link:

                              click here to download virtual clone drive
                                                               

                                  ( http://www.slysoft.com/en/virtual-clonedrive.html)

Choose Virtual CloneDrive (Freeware) which will be at no 7th and install it in your System.

After installation of "virtual clone drive" goto your iso image file location and right click on iso image file and choose Mount (Virtual CloneDrive:D)

-> go to computer. Now you will see BD-ROM Drive(D:) under removal devices inside computer.

-> Right Click on this and go for run setup.exe.

Now installation of windows 7 will start in your system and first wizard of installation will see like this:



. Click on install now and follow further process till completion of successful installation in your  System.

Note: During installation your system will restart several times so don't worry about this.


NOTE:: you can use same process for windows xp and vista also.


For more clarification please visit below mentioned video:

                                         How to install Windows 7 with an iso

                   (http://www.youtube.com/watch?v=dL7u-LEU19U)


     Stay with Techn!cal $olutions 4 u onlY  to get more Interesting         IT topics.