Hi,
I have a code written in Java and the system is giving me an error "Invalid method declaration, return type required". Please help me to rectify this. Thanks.
import java.io.*; class steve { public static long perimeter_rectangle(int l,int b) { long x=2*(l+b); return x; } public static long perimeter_square(int s) { long a=4*s; return a; } public static void main (string args[]) throws IOException; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); {System.out.println("1=perimeter of rectangle"); System.out.println("2=perimeter of square"); System.out.println("ENTER YOUR CHOICE");} String str=br.readLine(); int S=Integer.parseInt(str); Switch (S) { case 1: { System.out.println("enter the length n breadth"); String l=br.readLine(); int a=Integer.parseInt(l); String b=br.readline(); int c=Integer.parseInt(b); long x=perimeter_rectangle(a,c); System.out.println(x); break; } case 2: { System.out.println("enter d side"); String S=br.readLine(); int q=Integer.parseInt(s); long a=perimeter_square(q); System.out.println(a); break; } default: System.out.println("INVALID CHOICE"); }