Write a class encapsulating the concept of a file, assuming file has a single attribute: file name. Include constructor, mutator, accessor, tostring, and equals. Include an instance variable to keep track of the number of the files. Write a method that returns the number of files we have. Also include a method that returns the extension of the file. For example if the filename is text.java, your method will return java. If the file name does not include a dot, your method should return "unknown extension."
public class file
{
private string name;
private string extension;
private static int count = 0;
public File( String n, String e);
{
name = n;
extension = e;
count ++;
}
public class file
{
private string name;
private string extension;
private static int count = 0;
public File( String n, String e);
{
name = n;
extension = e;
count ++;
}