How to use functions and variables from different java class? -
i have design pdf document. job design 1st page(named "form.java") created methods parameters defining font, no. of cols & rows,...
function a(string staticdata, font font, int colspan, int rowspan, int border)
it worked fine.. have design 2 additional pages using similar format , same methods.
so created new java class(separate .java file) in put methods & declared variables..
then imported .java file form.java. gives me error cannot find function a(string staticdata, font font, int colspan, int rowspan, int border)... gives error variables in methods...
how can solve this.. donot want write same methods every page in same project... files in same package , classes public...
it basic in object oriented programming. create object
of class
, access public
methods.
so need create instance of object
of form class
, can able call method a
instancename.a(...)
like-
form form = new form(); form.a(...);
note : if both class in same package dont need import.
Comments
Post a Comment