Unit - 1 - Part2 JAVA Introduction
Unit - 1 - Part2 JAVA Introduction
Unit-2
Web Page Designing: HTML: List, Table, Images, Frames, forms, CSS, Document type definition, XML: DTD, XML schemes, Object Models, presenting and
using XML, Using XML Processors: DOM and SAX, Dynamic HTML
Unit-3
Scripting: Java script: Introduction, documents, forms, statements, functions, objects; introduction to AJAX, Networking : Internet Addressing, InetAddress,
Factory Methods, Instance Methods, TCP/IP Client Sockets, URL, URL Connection, TCP/IP Server Sockets, Datagram.
Unit-4
Enterprise Java Bean: Preparing a Class to be a JavaBeans, Creating a JavaBeans, JavaBeans Properties, Types of beans, Stateful Session bean, Stateless
Session bean, Entity bean
Java Database Connectivity (JDBC): Merging Data from Multiple Tables: Joining, Manipulating, Databases with JDBC, Prepared Statements,
Transaction Processing, Stored Procedures.
Unit-5
Servlets: Servlet Overview and Architecture, Interface Servlet and the Servlet Life Cycle, Handling HTTP get Requests, Handling HTTP post Requests,
Redirecting Requests to Other Resources, Session Tracking, Cookies, Session Tracking with Http Session
Java Server Pages (JSP): Introduction, Java Server Pages Overview, A First Java Server Page Example, Implicit Objects, Scripting, Standard Actions,
Directives, Custom Tag Libraries..
Subject:Web
Subject: Web Technology
Technology
JAVA Introduction
Phases:
• There are three execution phases of a program. These are written, compile and run.
• Writing a program is done by a java programmer like you and me.
• The compilation is done by the JAVAC compiler which is a primary Java compiler included in the Java
development kit (JDK). It takes Java program as input and generates bytecode as output.
• In the Run phase of a program, JVM executes the bytecode generated by the compiler.
2. Bytecode in the Development process: As discussed, the Javac compiler of JDK compiles the
java source code into bytecode so that it can be executed by JVM. It is saved as .class file by
the compiler.
3. Java Development Kit (JDK): As the name suggests, it is a complete Java Development Kit
that includes everything including compiler, Java Runtime Environment (JRE), java
debuggers, java docs, etc. For the program to execute in java, we need to install JDK on our
computer in order to create, compile and run the java program.
4. Java Runtime Environment (JRE): JDK includes JRE. JRE installation on our computers allows
the java program to run, however, we cannot compile it. JRE includes a browser, JVM, applet
supports, and plugins. For running the java program, a computer needs JRE.
Operator in Java is a symbol that is used to perform operations. For example: +, -, *, / etc.
There are many types of operators in Java which are given below:
• Unary Operator - ++, --, ~,!
• Arithmetic Operator - >, +,-,%,/,*
• Shift Operator - <<,>>
• Relational Operator - <,>,<=,>=,==
• Bitwise Operator – bitwise OR(|): The bitwise | operator always checks both conditions whether the
first condition is true or false. Bitwise AND(&): The bitwise & operator always checks both conditions
whether the first condition is true or false.
• Logical Operator - &&(AND) operator doesn’t check the second condition if the first condition is false.
It checks the second condition only if the first one is true, ||(OR) operator doesn’t check the second
if the first condition is true. It checks the second condition only if the first one is false.
• Local Variable:
A variable declared inside the body of the method is called a local variable.
Syntax: method() {
datatype variableName; // Local Variable
}
Subject: Web Technology
Variable in Java(Cont.….)
Static Variable:
A variable that is declared as static is called a static variable. Here “static” keywords is used to
declare a static variable.
Syntax: static datatype variableName; // Static variable
Instance Variable:
• A variable declared inside the class but outside the body of the method, is called an instance
variable. It is not declared static.
• It is called an instance variable because its value is instance-specific and is not shared among
instances.
• Every instance has its own copy of the instance variable.
• Syntax: class {
datatype variablename; // instance variable
}
int result = _a + $b + C + c;
System.out.println("Result: " + result);
}
} //Output - 100
These comments are useful to create an HTML file called API (application programming Interface) document.
This file contains a description of all the features of the software.
}
• In general, program execution starts with a main() method, and line-by-line execution of the program
tokens places a linear/Sequential flow of Execution.
PSV main()
{
line1 // Linear Sequential flow of execution
2
}
}
• In general, program execution starts with a main() method, and line-by-line execution of the program
tokens places a linear/Sequential flow of Execution.
PSV main()
{
line1 // Linear Sequential flow of execution
2
}
For example, the marks obtained by a student in 5 different subjects can be represented by a 1D array
We can declare a one-dimensional array and directly store elements at the time of its declaration, as:
int marks[] = {50, 60, 55, 67, 70};
We can create a 1D array by declaring the array first and then allocate memory for it by using a
new operator, as:
int marks[]; //declare marks array
marks = new int[5]; //allot memory for elements
Example: A dog is an object because it has states like color, name, breed, etc. as well as behaviours like wagging the
tail, barking, eating, etc.
In Java, the new keyword is used to create new objects.
Types of Method
There are two types of methods in Java:
• Predefined Method
• User-defined Method
Here are the different types of approaches how to take input from users in Java :
1. Using the Scanner Class
2. Using the BufferedReader Class
3. Using Command-Line Arguments