30
OBJECT ORIENTED PROGRAMMING WITH JAVA SUB CODE: 2720215 1 ST YEAR ME (EC) F ACULTY : MAHESH BARGAJE CONTACT :

Object Oriented Programming With JAVA

Embed Size (px)

DESCRIPTION

oop with java

Citation preview

  • OBJECT ORIENTED PROGRAMMINGWITH JAVA

    SUB CODE: 2720215

    1ST YEAR ME (EC)

    FACULTY: MAHESH BARGAJE

    CONTACT:

    https://twitter.com/MaheshBargaje1https://www.facebook.com/mahesh.bargajemailto:[email protected]://in.linkedin.com/pub/mahesh-bargaje/45/812/628/

  • SYLLABUS

  • UNIT 5: I/O AND APPLETS

    STREAMS; FILE I/O; APPLETS; PARAMETERPASSING TO APPLETS

  • INTRODUCTION

    We have used variables and arrays for storing data.

    Problems: Storage is temporary.

    Difficulty in handling large volume of data.

    Solution: Storing data in terms of FILEs on secondary

    storage devices such as: Floppy disks, CDs, Hard disks, etc.

  • CONCEPT OF STREAMS

  • CONCEPT OF STREAMS

  • CONCEPT OF STREAMS

  • STREAMS

    Streams - is the way we handle I/O.

    Why Streams?

    Uniformity in handling disparate data.

    Stream

    Composed of bytes or characters that we can read from or write to.

    Sources and Destinations

    Disk file, a memory buffer or a network.

  • STREAMS

    Package:

    Stream I/O is based on following classes:

    Byte Oriented Streams

    Character- Oriented Streams

  • USING FILE CLASS

    Package:

    This class is used for creation of files and directories, file searching, file deletion etc.

    It describes the Properties of a file.

    Directory is also treated as a file.

  • CREATING FILES

    Constructors:

    creates a new File instance by converting the given pathname string into an abstract pathname.

    creates a new File instance from a parent pathname string and a child pathname string.

    creates a new File instance from a parent abstract pathname and a child pathname string.

    creates a new File instance by converting the given file: URI into an abstract pathname.

  • METHODS OF FILE CLASS

  • WORKING WITH

    Package:

    byte-oriented class

    Streaming byte input

    Throws an

    Constructor:

    It constructs an InputStream object

  • WORKING WITH

    Methods of class:

  • WORKING WITH

    Package:

    byte-oriented class

    Streaming byte output

    Throws an

    Constructor:

    It constructs an OutputStream object

  • WORKING WITH

    Methods of class:

  • WORKING WITH

    Package:

    byte-oriented class

    Streaming byte output

    Throws an

    Constructor:

  • WORKING WITH

    Methods of class:

  • WORKING WITH

    Methods of class:

  • EXERCISE

    Write a program that reads from file and prints the contents.

    Whenever it encounters # it should skip reading until next # is encountered.

  • WORKING WITH R

    It supports positioning of the file pointer within a file.

    Access types are:

    r file is read and not written

    w- file opened in read-write mode

    rws- read write of contents/metadata synchronously to the storage

    rwd- read write of contents synchronously to the storage

  • WORKING WITH

    Package:

    Character-oriented class

    Streaming byte output

    Throws an

    Constructor:

  • WORKING WITH

    Methods of the class:

  • KEYBOARD INPUT: WORKING WITH

    Package:

    To read keys from the keyboard the source is

  • KEYBOARD INPUT: WORKING WITH

    Constructors:

  • KEYBOARD INPUT: WORKING WITH

    Methods of the

    class:

  • KEYBOARD INPUT: WORKING WITH

    Getting input from keyboard:

  • KEYBOARD INPUT: SCANNING INPUT WITHCLASS

    Getting input from keyboard:

    Getting input from a file: