#What does String mean in Sting word= triple("hello");
1 messages · Page 1 of 1 (latest)
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
ur line of code are actually two different actions:
- variable declaration
String word;
- variable assignment:
word = "Hello";
but in a short-hand statement
the first part creates a variable called word, which can refer to any String object
in the second part, u let it refer to a string object, given on the right side
int age = computeMyAge();
u mean like that?
that has nothing to do with the age variable then
its about what the right side computes to
what u put inside the (...) is the list of parameters of the method
public void foo(String name, int days) {
...
}
foo("John", 123)
this method returns nothing, says void
yes
or
int x = foo("John") + 3 * bar("aaa");
it computes it step by step
until it eventually is a number
and then it assigns it to the variable
it runs foo("John"), which maybe returns 10
then bar("aaa"), which maybe returns 20
and then compute
10 + 3 * 20
which is 70
and then its int x = 70;