]can we pass arguments from command line to a constructor (with parameters)?
I learned that we can print the command line arguments as output like in the below code
class CmndLineArguments {
public static void main(
String[] args) {
int length = args.length;
if (length <= 0) {
System.out.println("You need to enter some arguments.");
}
for (int i = 0; i < length; i++) {
System.out.println(args[i]);
}
}
}
but my doubt is how to pass command line arguments to a constructor or a method
please can you explain with an exanple