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

Can I use % with real numbers?

1078


what is meant by encapsulation?

1128


How do you ensure that n threads can access n resources without deadlock?

1353


describe method overloading

1076


What are the main uses of this keyword?

1120


What is meant by class and object in java?

1105


What is a get method?

1125


What is join () in java?

1011


How many bits is a float?

1059


explain autoboxing in java?

1040


How will you add panel to a frame?

1163


What is passing value java?

1102


What is singleton class in java and how can we make a class singleton?

1228


Explain abstract class in java?

1125


What is difference between equals and hashcode method?

1199