为什么在方法内return报错?
public String Bookname(String[] newBook){ //报了个This method must return a result of type String
Scanner o=new Scanner(System.in);
System.out.println("输入书名:");
String nam=o.nextLine();
for(int i=0;i<newBook.length;i++){
if(nam.equals(newBook[i])){
return newBook[i];
}
}
}