how we can write the string concatenation program in java.
Answer Posted / ashwini kumar vatsa
In java first all the integer or float etc declared are
converted into string so when we write
System.out.println("the name is"+x);where x is any primitive
type then first x is converted into string then it
concatenates with the other string so for concatenations
with other string we must have +operator.
class xyz{
static int x;
public static void main(String args[]){
xyz yz=new xyz();
yz.x=10;
System.out.println("the output is"+x);//here concat done
}
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
How do you declare a destructor in java?
What is a linkedhashmap java?
What is complexity and its types?
What is a arraylist in java?
what is daemon thread and which method is used to create the daemon thread? : Java thread
Can a class have multiple superclasses?
Write a program to find maximum and minimum number in array?
What do you understand by the term wrapper classes?
What is the size of arraylist in java?
How can we pass argument to a function by reference instead of pass by value?
What is an off by one error in java?
Write code to implement bubble sort in java?
What is json parser in java?
What are the 4 versions of java?
What is computer compiler?