Hi I am very new to java as its part of my course and I am stuck
I have written part of this basic code below
import java.util.Scanner;
import java.io.File;
import java.io.IOException;
import java.awt.image.BufferedImage;
import javax.imageio.imageIO;
import.java.awt.Color;
public class FinalExam
{
public static void main(String [] args) throws IOException
{
Scanner keyboardInput = new Scanner(System.in);
System.out.println("Input the address of the image (e.g. c:\\myPicture.jpg)");
String imageLocation = keyboardInput.nextLine();
File imageFile = new File(imageLocation);
BufferedImage storedImage = ImagIO.read(imageFile);
}
}
does anyone know I would change this code so that you would be allowed to supply the name of an image file a a command line argument when issuing the command to run the program?