Menu

Need Help Java Creating Exploring Pictures Main Method Class Pictureexplorer Every Class J Q43836383

I need help with Java:

Creating and exploring other pictures Here is the main method inthe class PictureExplorer. Every class in Java can have a mainmethod, and it is where execution starts when you execute thecommand java ClassName. public static void main( String args[]) {Picture pix = new Picture(“beach.jpg”); pix.explore(); } The bodyof the main method declares a reference to a Picture object namedpix and sets that variable to refer to a Picture object createdfrom the data stored in a JPEG file named “beach.jpg” in the imagesfolder. A JPEG file is one that follows an international standardfor storing picture data using lossy compression. Lossy compressionmeans that the amount of data that is stored is much smaller thanthe available data, but the part that is not stored is data wewon’t miss. Exercises 1. Modify the main method in thePictureExplorer class to create and explore a different picturefrom the images folder. 2. Add a picture to the images folder andthen create and explore that picture in the main method. If thepicture is very large (for instance, one from a digital camera),you can scale it using the scale method in the Picture class. Forexample, you can make a new picture (“smallMyPicture.jpg” in theimages folder) one-fourth the size of the original(“myPicture.jpg”) using: Picture p = new Picture(“myPicture.jpg”);Picture smallP = p.scale(0.25,0.25);smallP.write(“smallMyPicture.jpg”);

Expert Answer


Answer to I need help with Java: Creating and exploring other pictures Here is the main method in the class PictureExplorer. Every…

OR