Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2016
    Posts
    1
    Rep Power
    0

    Default Return type for the method is missing

    I really don't understand whats I did wrong here.

    package butt;

    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import java.net.URL;

    import javax.imageio.ImageIO;

    public class loadImageFrom {

    public static BufferedImage LoadImageFrom(Class<?> classfile, String path) {
    URL url = classfile.getResource(path);
    BufferedImage img = null;

    try{
    img = ImageIO.read(url);
    }catch(IOException e){
    e.printStackTrace();
    }
    return img;
    }

    }

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,007
    Rep Power
    34

    Default Re: Return type for the method is missing

    whats I did wrong here.
    Please explain why you think something is wrong.
    If you get any errors, copy the full text of the error messages and paste it here.

    Please edit your post and wrap your code with code tags:

    [code]
    **YOUR CODE GOES HERE**
    [/code]

    to get highlighting and preserve formatting.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 7
    Last Post: 04-02-2014, 03:15 PM
  2. Replies: 5
    Last Post: 01-17-2010, 12:14 AM
  3. Replies: 18
    Last Post: 12-02-2009, 01:01 PM
  4. [SOLVED] Undeclared Return Type for Method?
    By fullmetaljacket in forum New To Java
    Replies: 11
    Last Post: 05-16-2009, 04:38 AM
  5. Method return type problem
    By McChill in forum New To Java
    Replies: 7
    Last Post: 05-05-2009, 10:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •