0% found this document useful (0 votes)
28 views

Unit-I Chapter in Book - 2 Overview of Java: - K. Indhu

This document provides an overview of Java concepts including object-oriented programming principles like encapsulation, inheritance and polymorphism. It covers getting started with Java by writing, compiling and executing a simple program. Additional topics include comments, blocks, the main method and lexical issues. The goals are introduced in the beginning and each section provides details on the specified topic.

Uploaded by

Ghuru
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Unit-I Chapter in Book - 2 Overview of Java: - K. Indhu

This document provides an overview of Java concepts including object-oriented programming principles like encapsulation, inheritance and polymorphism. It covers getting started with Java by writing, compiling and executing a simple program. Additional topics include comments, blocks, the main method and lexical issues. The goals are introduced in the beginning and each section provides details on the specified topic.

Uploaded by

Ghuru
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

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
10.Block of a Program
11.Second Short Java Program
12.main() Method in Java
13.Third short Java Program
14.Java 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-> Example.java,
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!!!

You might also like