introductiontojava-110915052711-phpapp01

Upload: govind-gautam

Post on 04-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    1/22

    Click to edit Master subtitle style

    1/13/13 Object Oriented

    Object OrientedProgramming in

    JAVA

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    2/22

    1/13/13 Object Oriented

    Introduction

    Welcome to the course ObjectOriented Programming inJAVA. Thiscourse will cover a core set of

    computer science concepts neededto create a modern softwareapplication using Java.

    1/13/13 Object Oriented 22

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    3/22

    1/13/13 Object Oriented

    Course Objectives

    Oncompletion of this1/

    13/13 Object Oriented 33

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    4/22

    1/13/13 Object Oriented

    Course Syllabus

    1/13/13 Object Oriented 44

    UNIT CONCEPTS to be covered

    UNIT-I JAVA Basics

    UNIT-II Inheritance

    UNIT-III Data structures creation and manipulation in java

    UNIT-IV Exception Handling

    UNIT-V GUI Programming With JAVA

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    5/22

    Click to edit Master subtitle style

    1/13/13 Object Oriented

    JAVA Basics

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    6/22

    1/13/13 Object Oriented

    WhyJava is Important

    Two reasons :

    Trouble with C/C++ language is thatthey are not portable and are not

    platform independent languages.

    Emergence of World Wide Web, whichdemanded portable programs

    Portability and security necessitatedthe invention of Java

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    7/22

    1/13/13 Object Oriented

    History

    James Gosling - Sun Microsystems Co founder Vinod Khosla

    Oak - Java, May 20, 1995, Sun World

    JDK Evolutions JDK 1.0 (January 23, 1996)

    JDK 1.1 (February 19, 1997)

    J2SE 1.2 (December 8, 1998)

    J2SE 1.3 (May 8, 2000)

    J2SE 1.4 (February 6, 2002)

    J2SE 5.0 (September 30, 2004)

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    8/22

    1/13/13 Object Oriented

    Cont..

    Java Editions.

    J2SE(Java 2 Standard Edition) - to develop

    client-side standalone applications or applets.J2ME(Java 2 Micro Edition ) - to develop

    applications for mobile devices such as cell

    phones.

    J2EE(Java 2 Enterprise Edition ) - to develop

    server-side applications such as Java servlets

    and Java ServerPages.

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    9/22

    1/13/13 Object Oriented

    What isjava?

    A general-purpose object-oriented

    language.

    Write Once Run Anywhere (WORA).

    Designed for easy Web/Internet

    applications.

    Widespread acceptance.

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    10/22

    1/13/13 Object Oriented

    How isJava different fromC

    C Language:

    Major difference is that C is a structure orientedlanguage and Java is an object oriented languageand has mechanism to define classes and objects.

    Java does not support an explicit pointer type

    Java does not have preprocessor, so we cant use#define, #include and #ifdef statements.

    Java does not include structures, unions and enum

    data types. Java does not include keywords like goto, sizeof and

    typedef.

    Java adds labeled break and continue statements.

    Java adds many features required for object

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    11/22

    1/13/13 Object Oriented

    How isJava different fromC++

    C++ language

    Features removed in java:

    Java doesnt support pointers to avoidunauthorized access ofmemory locations.

    Java does not include structures, unions andenum data types.

    Java does not support operator over loading. Preprocessor plays less important role in C++

    and so eliminated entirely in java.

    Java does not perform automatic typeconversions that result in loss ofprecision.

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    12/22

    1/13/13 Object Oriented

    Cont

    Java does not support globalvariables. Every method and variable

    is declared within a class and formspart of that class.

    Java does not allow default

    arguments. Java does not support inheritance of

    multiple super classes by a sub class

    (i.e., multiple inheritance). This is

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    13/22

    1/13/13 Object Oriented

    Cont

    New features added in Java:

    Multithreading, that allows two ormore pieces of the same program toexecute concurrently.

    C++ has a set of library functionsthat use a common header file. But

    java replaces it with its own set of

    API classes.

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    14/22

    1/13/13 Object Oriented

    Cont

    Features that differ:

    Though C++ and java supports Boolean data

    type, C++ takes any nonzero value as true andzero as false. True and false in java arepredefined literals that are values for a booleanexpression.

    Java has replaced the destructor function with afinalize() function.

    C++ supports exception handling that is similarto java's. However, in C++ there is no

    requirement that a thrown exception be caught.

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    15/22

    1/13/13 Object Oriented

    Characteristics of Java

    Java is simple

    Java is object-oriented

    Java is distributed

    Java isinterpreted

    Java is robust

    Java isarchitecture-neutral

    Java is portable Javas

    performance

    Java ismultithreaded

    Java is dynamic

    Java is secure

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    16/22

    1/13/13 Object Oriented

    Java Environment

    Java includes many development tools,classes and methods

    Development tools are part of Java Development Kit(JDK) and

    The classes and methods are part ofJavaStandard Library (JSL), also known asApplication Programming Interface(API).

    JDK constitutes of tools like java compiler,java interpreter and many.

    API includes hundreds ofclasses and methodsgrouped into several packages according to

    their functionality.

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    17/22

    1/13/13 Object Oriented

    Java is architecture-neutral

    1/13/13 Object Oriented 1717

    JAVA Program Execution

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    18/22

    1/13/13 Object Oriented

    WORA(Write Once RunAnywhere)

    1/13/13 Object Oriented 1818

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    19/22

    1/13/13 Object Oriented

    Editplus for JavaProgramming

    Edit Plus Software:

    EditPlus is a 32-bit text editor forthe Microsoft Windows operatingsystem.

    The editor contains tools forprogrammers, including syntaxhighlighting (and support for customsyntax files), file type conversions,line ending conversion (between

    Linux, Windows and Mac styles),1/13/13 Object Oriented 1919

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    20/22

    1/13/13 Object Oriented

    Hello world Program in java

    1/13/13 Object Oriented 2020

    Execution of Hello world

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    21/22

    1/13/13 Object Oriented

    Execution of Hello worldProgram

    1/13/13 Object Oriented 2121

  • 7/30/2019 introductiontojava-110915052711-phpapp01

    22/22

    1/13/13 Object Oriented1/13/13 Object Oriented 2222

    Thankyou