I can't know why is the flowing code wrong? Please piont it out. Regards! import java.util.*; public class Test { public static void main(String[] args) { int storage(String s) { return s.length()*2; } Scanner sc=new Scanner(System.in); String str=sc.nextLine(); System.out.println(str.storage());
int Storage(String s) according to this syntax Storage function should be passed with a string when it is called and I think you are not passsing any string hence the error.