Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions