11th Jul 2017, 1:33 PM
Jay Chheda
Jay Chheda - avatar
2 Answers
+ 4
thanks bro it worked
11th Jul 2017, 1:58 PM
Jay Chheda
Jay Chheda - avatar
+ 7
remove the semicolon after area() and declare it static..... here's your modified code :- class Student { static int l=10,b=20,area; static void area() { area=l*b ; System.out.println("area="+area); } public static void main(String args[]) { System.out.println("l="+l); area(); } }
11th Jul 2017, 1:39 PM
cHiRaG GhOsH
cHiRaG GhOsH - avatar