File programming in java File programming in java with example how to read a file in java programming
file programming in java example what is file programming in java what is volatile application in java
what are volatile applications in java what is non volatile application in java what are non volatile applications in java Byte stream in java character stream in java definition of File define file programming definition of File programming define file
File
Programming:
In the
context of file programming java programmer can write two types of application
they are
1) Volatile
Application.
2) Non-Volatile
Application.
Volatile
or Non-Persistent Application:
Volatile Application is one which results are available in the main
memory. We
know that anything is storing in main memory is temporary i.e: as
long as power is on the
data will be available in main memory and once the
power is off the data of the main memory
is lost.
Non-Volatile
or Persistent Application:
The non-volatile or persistent application is
one whose basic aim to store the result
of java program in the persistently
devices permanently.
We know that to store data permanently, information
technology we have two approaches
they are.
a) Through
the concept of Files.
b) Through
the concept of Data Base.
If we store the data permanently in the form of files
then any unauthorized user can
manipulate the data of the file. In any programming
language the concept of files is unable
to provide enough security to the
confidential data from the unauthorized user. Hence Files
are providing no
security to the data. Hence industry is not recommended for storing the data
in
the form of files.
If we store the data permanently in the popular
databases(oracle, mysql, db2 etc…)
Then the data of the database is not possible to
manipulated by unauthorized users
because databases provides enough security in
the form of usernames and passwords
to secure the confidential data from
unauthorized users. Hence industry is always
recommended to store the data
permanently in the form of databases but not in the form
of files.
In order to deal with File Programming of java we must
import a predefined package
called java.io.*;
Definition
of File:
A File
is collection of records. And a Record is a collection of Filed values.
File names are always residing in secondary memory. If we
want to store any temporary
data permanently then we need to choose the file
name and write the data into file.
In java programming object which is residing in the main
memory is becoming an record in the file of secondary memory.
Operations
on Files:
1) Write
/OutputStream Operation
2) Read
/InputStream Operation
Definition
of Stream:
The flow of data between primary memory
and secondary memory is known as Stream.
Types
of Streams:
Based on transferring the data between
primary and secondary memory, streams are classified into two types. They are
1) Byte
Stream
2) Character
Stream
No comments:
Post a Comment