I don't understand the call to the parent class from within the class in this JAVA class -


can me understand why call parent class here? found download class seemed simple enough use wrapping brain around first method.

public class downloadhandler {          public static void main(string[] args) throws exception {              downloadhandler d = new downloadhandler();             d.urlsetup(args[0]);         } .... } 

i trying instantiate handler in loop , getting error.

downloadhandler file = new downloadhandler("http://example.com/"+cleanlink+"/"+filename+".pdf") 

it says "downloadhandler() in downloadhandler cannot applied (java.lang.string)"

your downloadhandler class has static void main method, single point of entry when executing command-line programs.

that method not constructor.

what initialize new instance of downloadhandler , invoking instance method on object passing given string argument.

not sure what's usage there.

in order initialization compile, want add constructor performs similar operations, given single string parameter in case.

for instance:

public downloadhandler(string s) {     urlsetup(s); } 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -