Scoping and Variablelength Arruguments
public class HelloWorld{ public static void main(String []args){ System.out.println("Hello World"); int b = 200; sum(); } static void sum(){ int a = 100; System.out.println(a); } } function scoping jasa ya sum() wala method ka under hum b ko access nahi kar sakta because wo function scope ka bahar haa sum(){ } Block level scope { } public class HelloWorld{ public static void main(String []args){ System.out.println("Hello World") { int c = 100; } System.out.println(c); } } asa karana ga toa error aya ga because hum block ka bhar c ko print karwa...
Comments
Post a Comment