Download as pdf or txt
Download as pdf or txt
You are on page 1of 50

History of web

Uses of internet
Internet in 1950’s
Internet in 1960’s

A network of computers that allows users to gather data and


access programs anywhere in the world.
In 1969, ARPA net delivered its first message – a
node-to-node communication from one computer to
another.
Internet in 1970’s
Internet in 1980’s
Internet in 1990’s
Phases of web development
Web Development refers to a term that includes all the processes involved in
developing a web project or website. It contains the various phases such as
1. Planning
2. Designing
3. Testing
4. Launching of the web project.
Strategy:

The first step in the web development process for a developer is to make a strategy
for developing a web page or website. In the strategy phase, a web developer has to
do the following:

1. Deciding goals and objectives

2. Developing team

3. Make the appropriate analysis associated with the problem and review the analysis

4. Formulate a list of tasks

5. Proposal of the project to the web team for developing


Design and Specification:

After the strategy-making, the next step in the web development process is to develop a
planned work. Web developer has to determine the schedule and the specifications.
The tasks in this phase are as follows –

1. Developing approach
2. Planning of contents needed for use
3. Making of rough design for the project
4. Making of final design from rough design, if there are no considerable
modifications in rough design.
5. Frame a prototype of the project for developing
6. Test the prototype
Production of the desired result:

In this phase of the web development process, the actual functional site is built.

1. After the proper testing of the prototype, the developer has to work on developing
the actual live web project.

2. The actual live web project is built according to the requirements of the client.

3. Web developer has to consider all the situations from the design phase to create all
the features in the web project.

4. This phase involves both front-end development and back-end development of the
website.
Online shopping website
Prototype
user Select products Add products Make online Invoice
into the cart payment generated

According to user requirement


Select products according to
price range
Select products
Select products by company
choice

By net banking
Make online
payment
By credit/debit card
Contd …
Front-end development comprises the writing codes with the basic technologies like
HTML, CSS, etc. according to the web standards. It generally starts by developing the
home page first and then other pages.

Back-end development is also completed in this phase by installing and configuring the
content management systems, databases, and frameworks.
Testing and Maintenance:
Testing is an important phase in the web development process. Testing is performed by
the developers and testers to ensure the client’s requirements after completion of the
web project.

In this phase, quality assurance and browser compatibility issues of the website are
checked. Testers test all the developed features and assure the validity of the written
code.

Various types of testing such as integration testing, regression testing, functional


testing, smoke testing, load testing, and performance testing are performed in this
phase by both testing and development teams.

Testing can be performed manually or automatically on the basis of the type of


testing and web projects. If desired and satisfactory results are not found, the proper
actions for removing the bugs are taken.
Integration testing All the modules of the system are simply put together and tested.

Regression testing

Select all test cases


Select test cases randomly- In this technique, test cases are selected randomly from the existing test
suite.
Select modification traversing test cases - In this technique, only those test cases have been selected
that cover and test the modified portions of the source code.
Functional testing

Load Testing

To find out the total count of users that can access the application at the same time.
To determine the scalability of the application.
Manual testing

Automatic testing
Registration with ISP:
The next step or phase is to register the web project with the regional
ISP to make the web project legal.
The web project is delivered to the client after uploading the website
to a server.
The client has to select and decide the ISP which provides domain
name registration and web hosting services.
Core Java
Procedural Programming –

1. Execution is done in the order instructions are given in the program.


2. Functionality written for a program is not utilized by any other program.

A sample program in C -

1. # include <stdio.h>
2. # include <conio.h>
3. Void main()
4. {
5. int x=10;
6. int y = 20;
7. int total = x+y;
8. printf(“%d”, total);
9. }
JDK
Java can be used to develop virtually any kind of
software applications like games that can run on PCs and
Mobiles, Desktop Applications, Web Applications,
Embedded Applications (for example applications that
can run in a watch or a pen), etc.

We need JDK (Java Development Kit) to develop


applications using Java.

JDK contains an important tool called compiler, which


transforms the source code written in Java to executable code.
This process is called compilation.

JRE (JRE) contains all the required tools and libraries to


execute the compiled Java code.
Java became quickly popular because the code written in Java can be run on any operating system
(Like, Windows, Linux, or Mac) provided it has the JRE (Java Runtime Environment) installed on it.

Operation code Binary Code

Windows ADD 1001

Linux ADD 1101

MAC ADD 11101

Convert according to machine


instructions of LINUX
JRE LINUX Hello.exe
java
Convert according to machine
Source code javac Byte code instructions of MAC
(hello.java) (hello.class) JRE MAC Hello.exe

Convert according to machine


JRE Windows
instructions of Windows
Hello.exe
Java portability

Windows ---
Int x= 10
Int y=20
Int sum = x+y ----- 1
Machine code ADD R1, M[x], M[y] -- Byte code -- .class file
1001 11 FF BB -- processor - instruct - add operation
Linux machine installed JRE - Java virtual machine
ADD – 11001 ADD R1, M[x], M[y] - not able to perform addition
Command – java --- JDK – tool (java interpreter) - activate - JVM - ADD - 11001
Platform independence feature – portability 22
Object Oriented Programming –

Key concepts –
1. Encapsulation
2. Polymorphism
3. Inheritance
4. Abstraction

1. Encapsulation – Binding of code within a class.

Class A
{

// Declare variables and functions here

}
Definition –

A class contains properties in the form of member variables and member methods.

Automobile - class Addition - class


Attributes – Attributes –
Gear, Brake, Head Light Integer: First, second
Properties of a
Functions – Functions – class
Move_straight() Add()
Move_right()
Move_left()
class A Class declaration
{
int x = 10 , y = 20; Attributes / member variables

int Add()
{
int sum = x + y; function/ member method It contains the properties
return sum; of a class. For object
} “ob”
} value of x = 10 and
value of y = 20.
class Use1
{ Access specifier
public static void main(String args[])
Keyword
reference {
variable A ob = new A() ; Object
int output = ob. Add ();
System.out.println (“sum = “ + output );
}
}
Use dot operator to access properties of a class package

A ob = new A();
class
ob . X
ob . Y concatenate operator
ob. Add() method
System.out.println(“Sum = “ + output);

Int x = 10;
Int y = 20;

System.out.println(“Sum = “ + x + y); Sum = 1020

System.out.println(“Sum = “ + (x + y)); Sum = 30 , due to


Operator Precedence
Object concept

class A { class B {
int a = 10; public static void main(String args[] )
} {
Instance variable
A ob1 = new A();
System.out.println(ob1.a); 10
ob1.a = 20;
a = 10
Object – ob1 a = 20 System.out.println(ob1.a); 20
(separate memory) A ob2 = new A();
System.out.println(ob2.a); 10

Object – ob2 a = 10 }
(separate memory) }
Class / static variable concept
class A {
static int a = 10;
}
Object – ob1
class B {
a = 10 public static void main(String args[] )
(shared memory) {
Object – ob2 A ob1 = new A();
System.out.println(ob1.a); 10
ob1.a = 20;
System.out.println(ob1.a); 20
A ob2 = new A();
System.out.println(ob2.a); 20
}
}
Class / static variable concept
class A {
Static variables can be accessed by class name also.
static int a = 10;
}
class B {
public static void main(String args[] )
{
System.out.println (A.a);
A.a = 20;
System.out.println(A.a);
}
}
Class / static variable concept contd .. class A {
int a = 10 , b = 20;
static int Add() {
int sum = a + b; }
}

class B {
public static void main(String args[] )
{
System.out.println (“Sum = “ + A.Add());
}
}

Error: Not static variables are not accessible in


static function
Datatypes in Java
Data Type Default size Boolean one = false
boolean 1 bit
byte a = 10
char 2 byte
byte 1 byte int a = 100000
short 2 byte
int 4 byte double d1 = 12.3
long 8 byte
char ch = 'A’
float 4 byte
double 8 byte Float a = 23.456
Type casting in java

Implicit type casting

byte a = 8;
int x = a + 20;

int a = 10;
byte x = a + 20; // error: not able to convert from lower range
data type to higher range data type

byte x = (byte) (a + 20) ; // Explicit type casting


public class Main{
public static void main(String[] args) {
char ch = 'a’;
int x= ch;
System.out.println(x); 97
}
}

public class Main{


public static void main(String[] args) {
int y = 20;
char ch1 = y; What is the output ?
System.out.println(ch1);
}
}
public class Main{
public static void main(String[] args) {
char ch = 'a’;
int x= ch;
System.out.println( (ch + x) ) ; // output: 194
}
}
Ambiguity with short

The below statement declares two short variables x and y initialized to 3 and 4 respectively.
short x = 3, y = 4;

short total = x + y;
However, when we try to perform an addition operation, such as given below,
we get a compilation error: Type mismatch: cannot convert from int to short.

Since x and y are of type short, they both are automatically widened to int, and the resultant int is
being assigned to sum which is of type short.

The compile-time error occurs while assigning the result which happens to be an int. To fix it, we will
have to explicitly typecast the result to a short, as shown below.

short total = (short) ( x + y) ;


Operators in Java
In Java, we have 5 arithmetic operators:

Operator Description
+ Used for addition and string
concatenation

- Used for subtraction

* Used for multiplication

/ Used for division


% Remainder/Modulus operator
for finding remainder
In Java, below are the comparison and relational operators:

Operator Description
== Checks if two values are equal

!= Checks if two values are not


equal
> Checks for greater-than
condition
>= Checks for
greater-than-or-equals condition

< Checks for less-than condition

<= Checks for less-than-or-equals


condition.
In Java, we have 5 Unary operators:

Operator Description
+ Unary Plus, used for indicating a positive value

- Unary Minus, subtracts from zero.


++ Increment operator. Increments the value by one.

-- Decrement operator. Decrements the value by one.

! Negation operator. Negates a boolean value.


Logical operator
Operator Description
&& This operator returns true when both the conditions under consideration are satisfied or are
true.
a = 10, b = 20, c = 20
condition1: a < b
condition2: b == c
if(condition1 && condition2)
d = a+b+c
// Since both the conditions are true
d = 50.
|| This operator returns true when one of the two conditions under consideration are satisfied
or are true.
a = 10, b = 20, c = 20
condition1:
a<b
condition2:
b > c if(condition1 || condition2)
d = a+b+c
// Since one of the condition is true
d = 50.
Logical operator

Operator Description
! this is a unary operator and returns true when the condition under consideration is
not satisfied or is a false condition.

a = 10, b = 20
!(a<b) // returns false

!(a>b) // returns true


Bitwise operator

Operator Description
Bitwise OR (|) This operator is a binary operator, denoted by ‘|’. It returns bit by bit OR
of input values.
a = 5 = 0101 (In Binary)
b = 7 = 0111 (In Binary)
Bitwise OR Operation of 5 and 7
0101 | 0111 = 0111 = 7 (In decimal)

Bitwise AND (&) This operator is a binary operator, denoted by ‘&.’ It returns bit by bit
AND of input values.
a = 5 = 0101 (In Binary)
b = 7 = 0111 (In Binary)
Bitwise AND Operation of 5 and 7
0101 & 0111 = 0101 = 5 (In decimal)
Bitwise operator

Operator Description
Bitwise XOR (^) This operator is a binary operator, denoted by ‘^.’ It returns bit by bit
XOR of input values.
a = 5 = 0101 (In Binary)
b = 7 = 0111 (In Binary)
Bitwise XOR Operation of 5 and 7
0101 ^ 0111 = 0010 = 2 (In decimal)

Bitwise Complement This operator is a unary operator, denoted by ‘~.’ It returns the one’s
(~) complement representation of the input value.
a = 5 = 0101 (In Binary)
Bitwise Complement Operation of 5 ~ 0101 = 1010 = 10 (In decimal)
Shift operator

Operator Description
Signed Left Shift (<<) The left shift operator moves all bits by a given number of bits to
the left.
int number = 2;
// 2 bit left shift operation
int Ans = number << 2;
Ans = 8
The right shift operator moves all bits by a given number of bits to
the right.
int number = 8;
// 2 bit signed right shift
int Ans = number >> 2;
Ans = 2

Signed Right Shift (>>)


Ternary Operator

Java ternary operator is the only conditional operator that takes three operands. It’s a
one-liner replacement for if-then-else statement and used a lot in Java programming.

num1 = 10;
num2 = 20;

res=(num1>num2) ? (num1+num2):(num1-num2)

You might also like