CORE JAVA PART 1

1.LANGUAGE
2.JAVA BUZZWORDS
3.CLASS
4.OBJECTS
5.JAVA PROGRAMING STRUCTURE
6.CONTROL STRUCTURES
7.METHODS & FUNCTIONS
8.POLYMORPHISM
9.CONSTRUCTORS


1.LANGUAGE:
************
  Language is nothing but which communicates two objects 
 in real world. Language establishes communication between hardware and software components.

2.JAVA BUZZWORDS:
****************

 SIMPLE:
  java is simple to develop for large scale application
  like windows/web based applications.
   
 ARCHITECTURAL NEUTRAL:
  it can run in any type of h/w architecture.
 PORTABLE:
  it can run on any type of Operating System.
 ROBUST:
  In some cases,there is a change of some run time errors
  to occur in the case of program execution then abnormal 
  program termination is occur,so that the data and 
  application may be lost.such type of errors is called
  Exception.
  if any language is handled these exceptions then that \
  language is called strictly written language.these languages
  are provide safety and security.
 DYNAMIC:
  Every object will be allocated dynamic to reduce the
  memory wastage.

 INTERPRETOR:
  In any languages translation is handled by compilers
  ,but in the java,program is first compiled by the javac
  then it will generate code called bytecode.

 DISTRIBUTED:  
  Java is net based application so that we have to share 
  the data and application among different users.
 HIGH PERFORMANCE:
  Even though more than 1 user is passing thier requests 
  at a time.
 MULTITHREADED:
  More than one program run simultaneously.
 SECURE:
  Java provides xlent security from unauthorized actions
  and provides firewall actions also.

 OBJECT-ORIENTED:
  Java is object oriented approach.it suports all
  the concepts oops such as data abstraction,encapsulation
  ,polymarphism and inheritance.


CLASS:
******

 class is a collection of properties and behaviour.
 behavior is nothing but a functions, properties are nothing
 but a variables.

 <access-specifiers> <modifiers> class class-name
 {
  // propeties
  //behaviours
 }

 program:

OBJECT:
********

 Object is nothing but a entity in a real world.chair,chalkpiece
 all r objects.
 in language view object is nothing but a reference of a class
 when ever create an object it occupies some memory with the class
 content.So with this is reference we are utilizing the class.

 object creation:
  class-name obj=new class-name(<parametes-list>);
 new is same as 'malloc' in c is used to create memory location for
  object in memory.

 **objects store the addresses just like pointers in c.**
 ---------------------------------------------------------

 program:

JAVA PROGRAMING STRUCTURE:
****************************
 
 Components:
  1.package declaration part
  2.package import statement part
  3.class definations.


CONTROL STRUCTURES:
********************
   Three types
    1.selection(if,switch) 
    2.iteration(for,while,do-while)
    3.jump(return,break)
    
 program:    
METHODS/FUNCTIONS:
******************
******************

 These are reusable components.Every function should have the
 return type.If any function does not return any value then return
 type should be declared as void.
 
 <access-specifiers> <modifiers> return-type methodname(parameters-list)
  {
   //body
   //return statement if return type is other than void.
  }


 program:

POLYMORPHISM
*******************
 POLYMORPHISM has two types method overloading and operator 
 overloading but in java operator oveloading is not supported.

 Method overloading is nothing but we can use single names for
 multiple purposes.it has same name but its parameters should 
 be different.
 

 program:

CONSTRUCTORS:
*************
  Constructor is a special type of member function.it is
 used to initilize the member variable at the time creating object
 
 Rules: 
  1.Constructor name should be equal with class name.
  2.it does not return any value so it shouldnt have the 
   return type even void also.
  3.we can define more than one constructors in a class.
  *4.these are not inheritable.
  5.it has a implicit call.these are invoked at the time 
    of object creation.

 Types of constructors:
  1.default 
  2.parametarized
  3.copy // it will copy the values of one object into another object.
 
 Destructor:
  it is also a special type of member function,which is
  used to destroy the objects,which are allocated by the constructor
  
  but java doesnt support it.java has garbage collector.
   java has internelly one mechanisam called 'garbage collector'
   to do destructor work.