Tuesday, August 9, 2011
Help with calling methods in Java?
In the main method you need to make object of the cl, if in the same directory, it is not required but it is always recommended to do so. so it would be like... Parse pp=new Parse. Now pp becomes your object. You have two methods one is array type and other is integer. So declare in main method: int a=pp.change('c'); "c is to be replaced by any character you want". The array is bit more complicated. You need to declare an array of the same size as what the method will return and then use the same procedure as for int. For eg. you have declared a particular array as b[]=new int ... then use b=pp.intParse("h"); "h is to be replaced by any character you want".
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment