Java Lab Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

TRIBHUWAN UNIVERSITY

Department of Humanities and Social Science

Object Orient Programming in JAVA

LAB REPORT
OOP in java Programming Language Lab
Course Code : CACS204

Submitted by
Amrit Rana
ID : 1080408
Bachelor In Computer Application
Semester III

Prepare By Amrit Rana


TRIBHUVAN UNIVERSITY
Department of Humanities and Social Science
Navakshitiz Collage
Bardibas
LAB REPORT ON
OOP IN JAVA

Experiment Date:
Submitted to:
Submission Date: Department of
Submitted by: Amrit Rana
Humanities and Social Science

Prepare By Amrit Rana


Title : File Handling.
Objective : An implementation of an interface is a java program that references the interface using the
implements keyword. In this lab we are going to learn about File Handling. File handling in Java implies
reading from and writing data to a file. The File class from the java.io package, allows us to work with
different formats of files. In order to use the File class, you need to create an object of the class and specify
the filename or directory name.

Problem 01:Write a Java program to copy a file to another file using ByteStream.

Code :

Output :

Problem 02: Write a Java program to copy a file to another file using CharacterStream.

Code :

Prepare By Amrit Rana


Problem 03: Write a program read from File in Standard Way in Java.
Code :

Prepare By Amrit Rana


Output:

Prepare By Amrit Rana


Problem 04: Write a program read from File Using Buffered Reader in Java.
Code :

Output :

Conclusion :
After the above study I have understood File Handling. and how to use File Handling. I learn many basic
things in java programmed. now I can create new file and file copy from character and byte . I can read file
Using Buffered Reader, Using File Reader class, Using Scanner class, Using Scanner class but without
using loops and with standard from. We will be in a position to crack so many stuff with our skills and we
will be able to capable of solving some great math and condition with java operators.

You might also like