UNIT- I
CHAPTER IN BOOK- 2
OVERVIEW OF JAVA
-K. Indhu
SYLLABUS COVERED HERE
Overview Of Java
K. INDHU
GOALS
1. Introduction
2. OOP (Encapsulation) in Java
3. OOP (Inheritance) in Java
4. OOP (Polymorphism) in Java
5. Getting Started with Java Program
6. Compiling Java Program
7. Creating & Compiling Java Application
8. Executing Java Application
9. Comments in Java
[Link] of a Program
[Link] Short Java Program
[Link]() Method in Java
[Link] short Java Program
[Link] Lexical Issues
K. INDHU
INTRODUCTION
Two Paradigms-> (i) Process Oriented Model,
(ii) Object Oriented Model.
The process-oriented model can be thought of
as code acting on data.
C implements process-oriented model.
An object-oriented model can be characterized
as data controlling access to code.
C++, Java implements object-oriented model.
K. INDHU
OOP (ENCAPSULATION) IN JAVA
K. INDHU
OOP (INHERITANCE) IN JAVA
K. INDHU
OOP (POLYMORPHISM) IN JAVA
K. INDHU
GETTING STARTED WITH JAVA
PROG.
1. Write a Simple Java Application,
2. Save the Java Application as-> [Link],
3. Compile the Java Application,
4. Run / Execute the Java Application.
K. INDHU
GETTING STARTED WITH JAVA
PROG.
The Java compiler requires that
a source file use the .java filename
extension.
The name of that class (in the code snippet) should match the
name of the file that holds the program.
Make sure that the capitalization of the filename matches the
class name.(The reason for this is that Java is case-sensitive.)
K. INDHU
COMPILING JAVA PROGRAM
K. INDHU
10
CREATING & COMPILING JAVA
APPLN.
K. INDHU
11
EXECUTING JAVA APPLN.
K. INDHU
12
COMMENTS IN JAVA
(1) int i = 10; // i is used as a counter
(2) THE MULTILINE COMMENT
This form of comment may also extend over several lines
as shown here:
/*
This is a longer comment
that extends over
five lines.
*/ P
(3) This is the documentation comment.
/**
This is a Java documentation comment.
*/
K. INDHU
13
BLOCK OF A PROGRAM
A pair of braces ( {...........} ) in a program forms a
block that groups components of a program.
K. INDHU
14
SECOND SHORT JAVA
PROGRAM
K. INDHU
15
main() METHOD IN JAVA
The main method provides the control of program flow. The
Java interpreter executes the application by invoking the main
method.
The main method looks like this->
public static void main(String[] args)
{
// Statements;
}
K. INDHU
16
THIRD SHORT JAVA PROGRAM
K. INDHU
17
JAVA LEXICAL ISSUES
K. INDHU
18
SO FAR WE STUDIED
Overview of Java
K. INDHU
19
HAPPY
LEARNING!!!