Java Programming
Java Programming
JVM:
Java Virtual Machine (JVM) is a program which behaves as interpreter and translates byte code
into machine language as they go called just in time compilation.
RAD:
Rapid Application Development is software programming technique that allow quick development of
software application.
Source Code: The core program or text which is written in a language like C,C++ or Java is
called source code.
Object Code: The program which only is understood by the computer in the form of machine
instructions or binary instructions called object code. In Java JVM is used to generate object
code in the form of byte code.
Byte code: A byte code is long instruction that the Java compiler generates and Java
interpreter executes. When the compiler compiles a .java file, it produces a series of bytecodes
and stores them in a .class file. The Java interpreter (JVM) can execute the byte codesstored in
the .class file.
Token: The
Keywords
Keywords are words that have a specific predefined meaning in Java.
They cannot be used as variable names. They are also known as reserve words.
Eg. void, private, if, while etc.
Literals:
Items having fixed data values are referred to as Literals. They are also
known as Constants. Various types of literals available in Java are :
integer iterals
Floating literals
Boolean literals
Character literals
String literals
Null literals
Variable:
Operators: Operators are special symbols that perform specific operations on one, two, orthree
operands, and then return a result.
Operators Precedence
postfix expr++ expr
unary ++exprexpr+exprexpr~ !
multiplicative * / %
additive + shift <<>>>>>
relational <><= >= instanceof
equality == !=
bitwise AND &
bitwise exclusive OR ^
bitwise inclusive OR |
logical AND &&
logical OR ||
ternary ? :
assignment = += =*= /= %= &= ^= |= <<= >>= >>>=
The import statement in Java allows programmers to refer to classes which are declared in other
packages to be accessed without referring to the full package name.
Eg.Import javax.swing.jOptionPane;
Eg.import javax.swing.*;
1.Local variable: The variable which is declared inside a method and is only accessible inside
that method is called a local variable.
2. Global variable: If a variable is declare outside all methods, then its scope includes all the
methods and it is said to be a global variable.
Inheritance
Inheritance is the capability of one class to inherit properties from an
existing class.
Need of Inheritance: Inheritance helps in two ways:
(i) Code Reusability: Inheritance helps in adding new features to a
class without modifying it. A pre-existing class can be directly be
reused in a new class.
(ii) Helps in expressing relationship among classes
Types of Inheritance:
a) Single ( 1:1) :
b) Hierarchical (1:M) : When several classes inherit from the same class
Types of Inheritance:
ODBC
ODBC mixes simple and advanced features together and has complex options for simple queries
ODBC requires manual installation of the ODBC driver manager and driver on all client machines
JDBC
JDBC is designed to keep things simple while allowing advanced capabilities when required
JDBC drivers are written in Java and JDBC code is automatically installable,
Advantages of JDBC
No Installation
Ans.A containers are a controls that can hold other controls within it e.g., a Frame(there can
be multiplecontrols inside a frame) or a label(it can hold an image and/or text) or simply
window (we can put somany controls on it). Controls inside a container are known as
child controls. The child controls canexist completely inside their containers. That means
we cans move them outside their container.
When we delete a container control, all its child controls automatically get deleted.