Web Application: Static (HTML) Dynamic (Java) Database (Oracle)

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 34

Web Application

Presentation Layer Application Layer Database Layer

Static (Html)

Dynamic (Java)

Database (Oracle)

Eg. Registration Form

Data Type
int char float

Data Type
int x;

Declaration

Data Type
int x = 10;

Declaration

Initialization

Data Type
int x = 10;

X holds integer value 10

Pointers
int
int

x;
Here we can store integer value

*ptr;
Here we can store the Address integer value

Pointers
int a = 100;

Holds the integer value.

int

*ptr = &a;
Holds the address of variable a.

Pointers
int a;
Value Type

int

*ptr;
Reference Type

C Language
int id;

void display() { cont<<id; }

C Language
int id;

void test1() { id=100; } void test2() { printf(id); }

C Language
int id;

Data member

void display() { cont<<id; }

Member function

Class
class Student { int id; void display() { cont<<id; } }

Blue Print

Class
class Student { int id; Student() { } }
Default Constructor

Class
Creating Object

class Student { int id; Student() { } }

Student

ob

Invoking Constructor

Pointers
int
Student

x;
Variable Declaration

ob;

Variable Declaration

2 The name ob stores the Object

Pointers
int
Student

x;
Pre-defined datatype

ob;

User-defined datatype

Pointers

Student

ob;

Object or Instance

Pointers
int
Student

x;
Value Type

ob;
Value Type

Class
class Demo { int x; }

Class
class Demo { int x; A ob; }

class A { }

Demo

o1;

Object creation of Demo class

Pointers
int Student *x;
Reference Type

*ob;
Reference Type

Pointers
Student ob;
Object creation

new Student()

Object creation

Pointers
int a = 100;

Holds the integer value.

int

*ptr = &a;
Holds the address of variable a.

Pointers
Student ob;
Holds the Object (Value Type).

Student

*ptr = &ob;

Holds the address of Student class Object (Reference Type).

Pointers
Student ob;
Object creation

new Student()

Object creation

Pointers
Student ob;
Student class Object

Student

*ptr = new Student();

Holds the address of Student class Object (Reference Type).

Pointers
Student ob;
Student class Object

Student

*ptr = new Student();

Holds the address of Student class Object (Reference Type).

Pointers
Student ob;
Value Type

Student

*ptr = new Student();

Reference Type

Object
class Student { int id; Student() { } }

Student

ob = new Student();

Instance (or) Object

Student

ob =

new Student();

ob.id=200; ob.display();

Data Members
class Sample { int a = Demo ob = }

1000; new Demo();


class Demo { }

Types of Variables

Instance variable. Class variable. Local variable.

Types of Methods

Instance method. Class method.

Instance variable and method


Demo o1=new Demo();

class Demo { int a; void sum() { cont<<a; } }

o1.a=1000; o1.sum();

Demo o2=new Demo(); o2.a=3000; o2.sum();

Demo
a a

o1

o2

Class variable and method


class Demo { static int a; static void sum() { cont<<a; } }

Demo.a = 5000;
Demo.sum();

Local variable
class Demo { void sum() { int a=200; cont<<a; } }

Local variable

You might also like