I am trying to upload 2 images and this is a class used for that. However, I am getting unreachable statement error.
public class uploadinfo {
private String imageName;
private String imageURL;
private String imageURL2;
public uploadinfo(){}
uploadinfo(String name, String url) {
this.imageName = name;
this.imageURL = url;
this.imageURL2 = url;
}
public String getImageName() {
return imageName;
}
public String getImageURL() {
return imageURL;
return imageURL2;
}}
Exeuction of a non-void method ends when a first RETURN statement is encountered, which is
return imageURL;in your example. The second return is never executed ( = it is unreachable), because first one returns execution back.You might split the method into two methods, for example
getImageURL()andgetImage2URL(), or return the URLs somehow packed (split by a space or any other character of your choice).