0

What if argument and initilisation are same in java?

what happen if i declare a string str with "hello" in java and then in main function make class obj and pass "hii" through the constructor to the same string what will be the result are they same or not.

20th Jun 2017, 7:15 PM
Nitin Singhal
Nitin Singhal - avatar
6 odpowiedzi
+ 1
can you give a pseudo example?
20th Jun 2017, 9:03 PM
Limitless
Limitless - avatar
+ 1
or maybe the code itself
20th Jun 2017, 9:03 PM
Limitless
Limitless - avatar
21st Jun 2017, 7:42 AM
Nitin Singhal
Nitin Singhal - avatar
0
I understand what you're trying to do, but it's just not possible. You'll need to start the program with command prompt then, and add an argument to it.
21st Jun 2017, 9:25 AM
Limitless
Limitless - avatar
21st Jun 2017, 9:36 AM
Limitless
Limitless - avatar
0
If you look at the class "myNumber" I returned a myNumber class within the class. If you create an instance of your main program, it is good practice not to make another instance of your main program inside your program.
21st Jun 2017, 9:37 AM
Limitless
Limitless - avatar