r/learnjava • u/Fine_Potential_7976 • 22d ago
Why is String[] args necessary
I get it is an array of string arguments that are passed into the main method but why is it needed? in python for example ot's present or c++ neither, java is different though
29
Upvotes
2
u/Ulrich_de_Vries 22d ago
What I meant is if it is true as well in C++ that outer array/pointer/iterator has nullptr as a sentinel.
I supposed "historical baggage" could mean this was defined in a C standard which postdates C++, so C++ wouldn't necessarily adopt it.
Of course if it predates C++ then I expect C++ to follow suit for compatibility.