EXP 8 PROGRAM FOR DISPLAYING FILE INFORMATION

  EX NO :8  PROGRAM FOR DISPLAYING FILE INFORMATION  AIM    To write a java program that reads a file name from the user, displays information about whether  the file exists, whether the file is readable, or writable, the type of file and the length of the file in bytes.   PROCEDURE    1. Create a class filedemo. Get the file name from the user .   2. Use the file functions and display the information about the file.   3. getName() displays the name of the file.   4. getPath() diplays the path name of the file.   5. getParent() -This method returns the pathname string of this abstract pathname’s parent, or null  if this pathname does not name a parent directory.   6. exists() – Checks whether the file exists or not.   7. canRead()-This method is basically a check if the file can be read.   8. canWrite()-verifies whether the application can write to the file. ...

EXP 4 PROGRAM FOR STACK ADT USING INTERFACE

 EX NO: 4


 PROGRAM FOR STACK ADT USING INTERFACE


For Codes Click here


AIM

To design a java application to implement array implementation of stack using the concept of interface

and exception handling.


PROCEDURE

1. Create the interface stackoperation with method declarations for push and pop.

2. Create the class astack which implements the interface and provides implementation for the

methods push and pop.Also define the method for displaying the values stored in the stack.Handle the

stack overflow and stack underflow condition .

3. Create the class teststack .Get the choice from the user for the operation to be performed . and also

handle the exception that occur while performing the stack operation.

4. Create the object and invoke the method for push,pop,display based on the input from the user.

Comments

Popular posts from this blog

EXP 3 PROGRAM TO GENERATE PAYSLIP USING INHERITANCE

EXP 1 JAVA PROGRAM TO GENERATE ELECTRICITY BILL

EXP 6 PROGRAM TO CALCULATE AREA USING ABSTRACT CLASS