Create a static method the Picture class which will create and return a Picture object from a passed ¯le name. Is this better or worse than using a constructor that takes a ¯le name?

What will be an ideal response?


```
/**
* Method to return a picture created
* from the file with the passed name
* @param fileName the name of the file
* @return pict the created picture
*/
public s tatic Picture getPictur e ( String fileName )
{
Picture p = new Picture ( fileName ) ;
return p ;
}
```
It is better to use a constructor for this since it does create a Picture object based
on information in the ¯le with the passed ¯le name. And, there is a constructor
that does this.

Computer Science & Information Technology

You might also like to view...

Prove that conflict equivalence implies viewequivalence.

What will be an ideal response?

Computer Science & Information Technology

To delete a subfolder from the computer entirely, use the Delete command.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Character entities end with a colon (:)

Indicate whether the statement is true or false

Computer Science & Information Technology

To correct photos, the Picture button must be selected on the Format Picture task pane.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology