Question: write a class encapsulating the concept of a file, assuming the file has the following attribute: the name of file. Include a constrcutor, the accessors

write a class encapsulating the concept of a file, assuming the file has the following attribute:

the name of file. Include a constrcutor, the accessors and mutators, and methods toSting() and equals().

Also include and method that returns the extension of the file, that is the letters following the last dot in the file (for instance if the file name is Test.java, then the method should return java ); if there is no dot in the file name, then the method should return "unknown extension". Write a client class to test all the methods in your class.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!