Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are different data types?

959


Is there any way to skip finally block of exception even if some exception occurs in the exception block?

999


Which are the two subclasses under exception class?

1001


What is nextline method in java?

974


What is the basic difference between string and stringbuffer object?

1024


Which collection is thread safe in java?

937


Explain the difference between hashmap and hashtable in java?

886


How to find the largest value from the given array.

965


What does percent mean in java?

966


What is the difference between double and float variables in java?

1082


Can a constructor be protected?

1029


What java ide should I use?

931


What is an eror in java?

989


Why call by value prevents parameter value change?

1010


Explain about method local inner classes or local inner classes in java?

963