Tuesday, 4 February 2014
How To create Blog In Blogger.com With Gmail Account
in: Blogger
Copy Constructor In java
in: C Plus Core JavaCopy Constructor :
Copy constructor is a intialize one object from other object and generally we assignment Operator to invoked copy constructor.
It Intialize value from one object to another.one The object created from class then not possible to use second time they are use with copy constructor.They inialize value from one object to copy to onother one.
which are The access Modifier In java?
in: Core JavaAccess modifier are properties of a class/method/veriable while access modifier are five types
- Final
- static
- Synchronization
- Abstract
- Transient
Final :
- A java variable can be declared using the keyword final. Then the final variable can be assigned only once.
- A variable that is declared as final and not initialized is called a blank final variable. A blank final variable forces the constructors to initialise it.
- Java classes declared as final cannot be extended. Restricting inheritance!
- Methods declared as final cannot be overridden. In methods private is equal to final, but in variables it is not.
- Final parameters – values of the parameters cannot be changed after initialization. Do a small java exercise to find out the implications of final parameters in method overriding.
- Java local classes can only reference local variables and parameters that are declared as final.
- A visible advantage of declaring a java variable as static final is, the compiled java class results in faster performance.
- A java variable can be declared using the keyword final. Then the final variable can be assigned only once.
- A variable that is declared as final and not initialized is called a blank final variable. A blank final variable forces the constructors to initialise it.
- Java classes declared as final cannot be extended. Restricting inheritance!
- Methods declared as final cannot be overridden. In methods private is equal to final, but in variables it is not.
- Final parameters – values of the parameters cannot be changed after initialization. Do a small java exercise to find out the implications of final parameters in method overriding.
- Java local classes can only reference local variables and parameters that are declared as final.
- A visible advantage of declaring a java variable as static final is, the compiled java class results in faster performance.
Monday, 3 February 2014
what is Polymorphism In Java?
in: C Plus Core JavaPolymorphism :
It is greek Word poly Means Many Morphism Means Forms Thats call Many Forms.
"Same Class Name But Diffrent parameter call polymorphism"
Example :
There Are Two Types Of Polymorphism
- Compile Time Polymorphism
- Run Time Polymorphism
- Compile Time Polymorphism : Define Multiple Method With Same Class Name but Diffrent Passing Parameter.
- Run Time Polymorphism : If base class and derived class have member functions with same name and arguments. If you create an object of derived class and write code to access that member function then, the member function in derived class is only invoked.
Inheritance program With access Specifier In Java.
in: Core Java An Access Specifier Is a main part of java program they are not posiblity of make program with out access specifier.
There are Four access Specifier In Java.
There are Four access Specifier In Java.
- public
- private
- protected
- Default
There Are six type of inheritance of Java.
- Single Inheritance
- Multilevel Inheritance
- Multipath Inheritance
- Multipal Inheritance
- Hybride Inheritance
Abstract Method In Java?
in: Core JavaAbstract:
An abstract is a return Type.It must be a extended or sub class.a abstract class contain static data.Any class with an abstract method is automatically abstract itself .
Syntax : abstract class class_Name
{
// Body
}
Rules :
- Abstract classes are not Interface.
- An abstract class must have an abstarct method.
- Abstract classes can have constructors,member variables and normal methods.
- Abstract class Never instatiated.
- When you extend abstarct class with abstarct method,you must define the abstract method in the child class.