ADVANCED JAVA PROGRAMMING
UNIT-1
OVERVIEW OF JAVA
CONTENT
 Introduction
 Objects Oriented Programming
 Lexical Issue
 Data Types
 Variable and Array
 Operators
 Inheritance
 Control statement
Introduction :
 Advanced Java is everything that goes beyond core java
 Importantly,APIs define in Java enterprise ededition,include:
Servlet programming,
web services,
The Presistence API,
 It’s a Web and Enterprise application development platform which basically Client
and Server architecture.
Object Oriented Programming :
 OOP is an approach to program organization and development, which attempts
to eliminate some of the drawbacks of conventional programming methods by
incorporating the best of several new concepts
 OOP allow us decompose a problem into number of entities called Object and
then build data and methods around these entities
 The data of an object can be accessed only by the methods associated with the
object
Classes:
 Class is blue print or an idea of object
 From one class any number of Instance can be created
 It’s an encapsulation of attributes and methods
Class.
Obj1. Obj2 Obj3
Figure
Circle Rectangular Square
Syntax of Class :
Class <Class Name >
{
Attribute /variables;
Constructor ();
Methods();
}
Instance :
 Instance is an object of a class which is an entity with it’s own attribute values and
methods
 Creating instance :
ClassName refVariable;
refVariable =new Constructor ();
Or
ClaasName refVariable =new Constructor();
Java Class Hierarchy :
 In Java, class “object ” is the base class to all other classes
 If we do not explicitly say extends in a new class definition, it implicitly extends
object
 The tree of class that extend from object and all of It’s subclass hierarchy
 All classes eventually lead back up to obobjectsThis will enable consistent access
of different classes
Inheritance :
 Methods allowed to reuse a sequence of statements
 Inheritance allows to reuse Classes by deriving a new class from an existing one
 The existing class is called the parent class, or subclass, or base class
 The derived class is called the child class or subclass
 The child class inherits characteristic of the parent class
 Data abstraction organize data.
 Is a essential elements of oop.
 Is the use of hierarchical classification .
Encapsulation :
 Data manipulate and keep both safe from outside interface .
 Productive wrapper the code and data.
 Encapsulation as a class, it defines the member variable, instance variable .
Data Abstraction :
Polymorphism :
 It allow one interface to use for general class.
 It’s more than one form.
 Integer, Floating point, Character in three types of stack.
Lexical Issues :
 White Space
 Identifier
 Literals
 Comments
 Separator
 keywords
Whitespace:
 Whitespace is a Java may be,
 A space
 A newline
 A tab
Identifier :
 Used for naming variable names, methods names and class name
 Should not start with a number
 Upper, lower case alphabet
Example :
Audi count a7 this_is_ok
Literals:
 It is a constant created in java
88 76.5 ‘A’ “ I am a string ”
 88 is an integer
 76.5 is a float
 ‘A’ Is a character
 “I am a string “ is a sstring
Comments:
 Single line, multiple line
 Documentation comment
/**and end with a*/
 Produce an html file
Separators:
 Few character are used, most commonly used semicolon.
 () method definition
 {} define block of code,class method
 [] declare array types
 . Separate package name
 , separate consecutive identifier in a variable declaration
Keywords :
 It can’t use class, variable, methods
 50keyword to be used
Example:
abstract for goto do
this if Super long
throw public char static
Data type in java :
Datatype
Primitive data
Types
Non-primitive
Datatypes
Numeric Boolean Character Array Object
Int Float long
Data types:
Integer :
 Java define four integer type :
Byte
short
Int
Long
 All of these are signed, positive and negative value.
 Java doesn’t support unsigned positive only integer
Floating point
 There are two types in java
Double
Float
 Float f=56.8929929
 Double d=4.5877
Boolean Data type :
 A boolean data type Is declared With The boolean keyword and only take the value true or false
The character data type :
 The character data type is single 16bit Unicode character.
CharGrade=‘A'
Variable and Array :
Variable:
 A variable is a named field containing information that your program uses
 A variable as a name of the memory location where the variable value is stored
Declaring variable:
Type identifier [=value ][,identifier [=value ]…..]
Array:
 An array is group of like _typed variables that are referred to by a common name
 An array can be of any type
 Specific element in an array is accessed by its indax
 Can have more than one dimention
Declaration OF ARRAY
 The general form of Array
Type[]var_name
int a1[]= new int[3];
Operators:
 Unary Operator
 Arithmetic Operator
 Shift Operator
 Relational Operator
 Bitwise Operator
 Logical Operator
 Assignment Operator
Unary Operator :
 The Java Unary Operator require one operand.Unary operator are used to
perform various operation
 Incrementing /decrementing a value by one
 Nagative an expression
 Inverting the value of a boolean
Arithmetic Operator :
 Arithmetic Operator are used to perform mathematical operation like, addition,
subtraction, multiplication
Relational Operator :
 The equality and relational operator determines the relationship between two
operands
 It check if an is greater than, less than, equal to, not equal to and so on
 Depending on the relationship, it results to their true or false
Logical Operator :
 The logical operator ||(conditional OR)and&&(conditional AND) Operats on
boolean expression.
Control statement in java:
Control statement
Selection
Iteration
Jump
THANK YOU

PCSTt11 overview of java

  • 2.
  • 3.
    CONTENT  Introduction  ObjectsOriented Programming  Lexical Issue  Data Types  Variable and Array  Operators  Inheritance  Control statement
  • 4.
    Introduction :  AdvancedJava is everything that goes beyond core java  Importantly,APIs define in Java enterprise ededition,include: Servlet programming, web services, The Presistence API,  It’s a Web and Enterprise application development platform which basically Client and Server architecture.
  • 5.
    Object Oriented Programming:  OOP is an approach to program organization and development, which attempts to eliminate some of the drawbacks of conventional programming methods by incorporating the best of several new concepts  OOP allow us decompose a problem into number of entities called Object and then build data and methods around these entities  The data of an object can be accessed only by the methods associated with the object
  • 6.
    Classes:  Class isblue print or an idea of object  From one class any number of Instance can be created  It’s an encapsulation of attributes and methods Class. Obj1. Obj2 Obj3 Figure Circle Rectangular Square
  • 7.
    Syntax of Class: Class <Class Name > { Attribute /variables; Constructor (); Methods(); }
  • 8.
    Instance :  Instanceis an object of a class which is an entity with it’s own attribute values and methods  Creating instance : ClassName refVariable; refVariable =new Constructor (); Or ClaasName refVariable =new Constructor();
  • 9.
    Java Class Hierarchy:  In Java, class “object ” is the base class to all other classes  If we do not explicitly say extends in a new class definition, it implicitly extends object  The tree of class that extend from object and all of It’s subclass hierarchy  All classes eventually lead back up to obobjectsThis will enable consistent access of different classes
  • 10.
    Inheritance :  Methodsallowed to reuse a sequence of statements  Inheritance allows to reuse Classes by deriving a new class from an existing one  The existing class is called the parent class, or subclass, or base class  The derived class is called the child class or subclass  The child class inherits characteristic of the parent class
  • 11.
     Data abstractionorganize data.  Is a essential elements of oop.  Is the use of hierarchical classification . Encapsulation :  Data manipulate and keep both safe from outside interface .  Productive wrapper the code and data.  Encapsulation as a class, it defines the member variable, instance variable . Data Abstraction :
  • 12.
    Polymorphism :  Itallow one interface to use for general class.  It’s more than one form.  Integer, Floating point, Character in three types of stack.
  • 13.
    Lexical Issues : White Space  Identifier  Literals  Comments  Separator  keywords
  • 14.
    Whitespace:  Whitespace isa Java may be,  A space  A newline  A tab Identifier :  Used for naming variable names, methods names and class name  Should not start with a number  Upper, lower case alphabet Example : Audi count a7 this_is_ok
  • 15.
    Literals:  It isa constant created in java 88 76.5 ‘A’ “ I am a string ”  88 is an integer  76.5 is a float  ‘A’ Is a character  “I am a string “ is a sstring Comments:  Single line, multiple line  Documentation comment /**and end with a*/  Produce an html file
  • 16.
    Separators:  Few characterare used, most commonly used semicolon.  () method definition  {} define block of code,class method  [] declare array types  . Separate package name  , separate consecutive identifier in a variable declaration
  • 17.
    Keywords :  Itcan’t use class, variable, methods  50keyword to be used Example: abstract for goto do this if Super long throw public char static
  • 18.
    Data type injava : Datatype Primitive data Types Non-primitive Datatypes Numeric Boolean Character Array Object Int Float long
  • 19.
    Data types: Integer : Java define four integer type : Byte short Int Long  All of these are signed, positive and negative value.  Java doesn’t support unsigned positive only integer
  • 20.
    Floating point  Thereare two types in java Double Float  Float f=56.8929929  Double d=4.5877 Boolean Data type :  A boolean data type Is declared With The boolean keyword and only take the value true or false The character data type :  The character data type is single 16bit Unicode character. CharGrade=‘A'
  • 21.
    Variable and Array: Variable:  A variable is a named field containing information that your program uses  A variable as a name of the memory location where the variable value is stored Declaring variable: Type identifier [=value ][,identifier [=value ]…..] Array:  An array is group of like _typed variables that are referred to by a common name  An array can be of any type  Specific element in an array is accessed by its indax  Can have more than one dimention
  • 22.
    Declaration OF ARRAY The general form of Array Type[]var_name int a1[]= new int[3];
  • 23.
    Operators:  Unary Operator Arithmetic Operator  Shift Operator  Relational Operator  Bitwise Operator  Logical Operator  Assignment Operator
  • 24.
    Unary Operator : The Java Unary Operator require one operand.Unary operator are used to perform various operation  Incrementing /decrementing a value by one  Nagative an expression  Inverting the value of a boolean
  • 25.
    Arithmetic Operator : Arithmetic Operator are used to perform mathematical operation like, addition, subtraction, multiplication
  • 26.
    Relational Operator : The equality and relational operator determines the relationship between two operands  It check if an is greater than, less than, equal to, not equal to and so on  Depending on the relationship, it results to their true or false
  • 27.
    Logical Operator : The logical operator ||(conditional OR)and&&(conditional AND) Operats on boolean expression.
  • 28.
    Control statement injava: Control statement Selection Iteration Jump
  • 29.