Forums Register Login

Parameter passing in methods

+Pie Number of slices to send: Send
In code journalOrderString is defined as a String type.
journalOrderString = JournalUtil.getRecordedJournalOrder(scriptName + ".tst");
It is calling getRecordedJournalOrder()method from another class;
public static String getRecordedJournalOrder(String scriptName)
But here it is taking only scriptName as arguement and not scriptName + ".tst";

Can anybody explain?
+Pie Number of slices to send: Send
follow the links in this recent topic to discover your answer

https://coderanch.com/t/569326/java/java/when-arguments-parameters-return-exactly
+Pie Number of slices to send: Send
Thanks Michael Dunn for your link.

But I want to know can we pass 2 values-(scriptName + ".tst");
to a method accepting only one argument -getRecordedJournalOrder(String scriptName),like we see in code.
+Pie Number of slices to send: Send
 

Arpit gmail wrote:Thanks Michael Dunn for your link.

But I want to know can we pass 2 values-(scriptName + ".tst");
to a method accepting only one argument -getRecordedJournalOrder(String scriptName),like we see in code.


Isn't it easier to try it out yourself? Did you? What happened? What do you think scriptName+".tst" evaluates to?
+Pie Number of slices to send: Send
 

Maneesh Godbole wrote:

Arpit gmail wrote:Thanks Michael Dunn for your link
"Isn't it easier to try it out yourself? Did you? What happened? What do you think scriptName+".tst" evaluates to?"

It's working fine .But I want to know what does this mean scriptName+".tst"-It's appending .tst to scriptname?

 
+Pie Number of slices to send: Send
> But I want to know can we pass 2 values-(scriptName + ".tst");

is it 2 values?

simple demo



are 2 values printed?
+Pie Number of slices to send: Send
Recommended reading: String API, especially the part where it talks about concatenation
+Pie Number of slices to send: Send
Thanks,

I got the concept behind it:-)
This one time, at bandcamp, I had relations with a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 695 times.
Similar Threads
Inner Class
Class path problem Help please
Constructor not executing? Help !!
Error while calling a schell script from java
Servlets calling unix scripts
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:12:11.