send parameter to class

hi all

i send parameter to argument in class and want to use it in other methods of class, but my variables in ClassDeclaration does not be recognized in Main method and rise this error that variable has not been declared.

static void main(Args _args)










please help me


Hi Mahdi,

  1. You need to declare new class variable in main method.

  2. Create one new parm method which should return the class variable.

  3. Call that parm method from main method by passing the current class variable.

  4. Now you can use that class in other methods which is in the same class.



dear abbas

there are two types of methods:

a) static methods that can just call static methods and can not call local variable or can not see class variable that is for every objects of class.

b) local methods that can call all methods.

main method is static method and i can not set local variable or call local method, i should define parm method as static, and can not assign local variable in that parm method. is there any solution?