Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Java Basics

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 13

Dr.

SNS Rajalakhsmi College of Arts and Science


(An Autonomous Co-Education Institution)
Coimbatore – 641049
www.drsnsrcas.ac.in

JAVA BASICS

Presentation by
Mrs.S.Janani
Assistant Professor
Department of Information Technology
pc.fin@drsnsrcas.ac.in
Department of

IT
Information
Technology
Drsnsrcas/CPreprocessor/April 27, 2024 Slide No : 1
INTRODUCTION

Java is platform independent: the same program can run on any correctly
implemented Java system

• Java is object-oriented:
Structured in terms of classes, which group data with operations on that data
Can construct new classes by extending existing ones

• Java designed as
A core language plus
A rich collection of commonly available packages

• Java can be embedded in Web pages

Department of
www.snsgroup.com
IT Information
Technology
Drsnsrcas/CPreprocessor/April 27, 2024 Slide No : 2
INTRODUCTION

 Java is a general – purpose ,


Compiled and
object-oriented programming
interpreted
language developed by sun
Platform-independent
Microsoft of USA in 1991.
and portable
_x0002_ Object-oriented
 Originally called Oak by
Robust and secure
james gosling,one of the
Distributed
inventors of the language.
Familiar
Simple and small
 Java is a first programming
High performance
language which provide the
concept of writing programs that
can be executed using the web.

Department of
www.snsgroup.com
IT Information
Technology
Drsnsrcas/CPreprocessor/April 27, 2024 Slide No : 3
INTRODUCTION

Desktop application :-acrobat reader,Media


player,antiviruse etc.

Enterprise application :-
banking application,Business application.
 Mobile.
Embedded system.
Games.
Robotics.

Department of
www.snsgroup.com
IT Information
Technology
Drsnsrcas/CPreprocessor/April 27, 2024 Slide No : 4
INTRODUCTION

Department of
www.snsgroup.com
IT Information
Technology
Drsnsrcas/CPreprocessor/April 27, 2024 Slide No : 5
INTRODUCTION

Department of
www.snsgroup.com
IT Information
Technology
Drsnsrcas/CPreprocessor/April 27, 2024 Slide No : 6
Begin with Java source code in
text files:
Model.java
A Java source code compiler
produces Java byte code
Outputs one file per class:
Model.class
May be standalone or part of an
IDE
A Java Virtual Machine loads and
executes class files
May compile them to native code
(e.g., x86) internally

Introduction to Java
Department of
www.snsgroup.com
IT
Information
Technology
Drsnsrcas/CPreprocessor/April 27, 2024 Slide No : 7
The Java API
API = Application Programming Interface

Java = small core + extensive collection of packages


A package consists of some related Java classes:

Swing: a GUI (graphical user interface) package


AWT: Application Window Toolkit (more GUI)
util: utility data structures (important to CS 187!)

The import statement tells the compiler to make available classes and
methods of another package

A main method indicates where to begin executing a class (if it is


designed to be run as a program)

Department of
www.snsgroup.com
IT Information
Technology Drsnsrcas/CPreprocessor/April 27, 2024
Slide No : 8
The Java

Java does not include the C


unique statement keywords
sizeof,and typedef.

Java does not contain the data


types struct and union.

Java does not support an explicit


pointer type.

Java does not have a


preprocessor and therefore we
cannot use #define,#include
statement.

Department of
www.snsgroup.com
IT Information
Technology Drsnsrcas/CPreprocessor/April 27, 2024
Slide No : 9
METHODS

A method in Java is a block of code that, when called, performs


specific actions mentioned in it.

For instance, if you have written instructions to draw a circle in


the method, it will do that task.

You can insert values or parameters into methods, and they will
only be executed when called

A method in Java is a set of instructions that can be called for


execution using the method name.

Department of
www.snsgroup.com
IT Information
Technology
Drsnsrcas/CPreprocessor/April 27, 2024 Slide No : 10
CLASSES

A class is a template for an object and an object is an instance of a


class.

When defining a class, the data that it contains and the code that
operates on that data has to be specified.

A class is declared by use of the 'class' keyword.


The data or variables, defined within a class are called instance
variables.

Department of
www.snsgroup.com
IT Information
Technology
Drsnsrcas/CPreprocessor/April 27, 2024 Slide No : 11
CONTROL STATEMENT

The while loop loops through a block of code as


long as a specified condition is true

When you know exactly how many times you


want to loop through a block of code, use
the for loop instead of a while loop:

The do/while loop is a variant of


the while loop. This loop will execute the code
block once, before checking if the condition is
true, then it will repeat the loop as long as the
condition is true.
Department of
www.snsgroup.com
IT Information
Technology
Drsnsrcas/CPreprocessor/April 27, 2024 Slide No : 12
Department of
www.snsgroup.com
IT
Information
Technology Drsnsrcas/CPreprocessor/April 27, 2024

You might also like