Question: Write a class encapsulating the concept of a file, assuming a file has only a single attribute: the name of the file. Include a constructor,

 Write a class encapsulating the concept of a file, assuming a

Write a class encapsulating the concept of a file, assuming a file has only a single attribute: the name of the file. Include a constructor, the accessors and mutators, and methods to String and equals. Also, code a method returning the extension of the file, that is, the letters after 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!