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.

Answers were Sorted based on User's Feedback



how we can write the string concatenation program in java...

Answer / kandavel

class conc
{
public static void main(String args[])
{
String a="kanda",b="Vel",c;
c=a+b;
System.out.println(" Concat String :"+c);
}}

//This program must save the file name is conc.java

Is This Answer Correct ?    17 Yes 0 No

how we can write the string concatenation program in java...

Answer / sreekanth

public class StringConcat{
public static void main(String args[]){
String str1="abc";
String str2="def";
String str3=str1.concat(str2);
System.out.println(str3);
}}

Is This Answer Correct ?    6 Yes 0 No

how we can write the string concatenation program in java...

Answer / 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

More Core Java Interview Questions

Discuss about garbage collector in Java.

0 Answers   Agilent, Integreon, ZS Associates,


What are the four integer types supported by java?

0 Answers  


Why Java is not purely object oriented?

50 Answers   Elitecore, Persistent, Reliance, Wipro,


what is an virtual function

2 Answers   TCS,


Explain about main() method in java ?

0 Answers  


Can we have multiple public classes in a java source file?

0 Answers  


what is features of jdk 1.5?

2 Answers   Accenture, Satyam, TCS,


we know that every java prog must follows OOPS Principles. Anybody can answer, HOW THE FOLLOWING PROGRAM FOLLOWS OOPS CONCEPTS i.e, Inheritance,Polymarphism,Encapsulation? class a{ public static void main(String args[]){ System.out.println("Hello World"); } }

3 Answers  


what are three ways in which a thread can enter the waiting state? Or what are different ways in which a thread can enter the waiting state? : Java thread

0 Answers  


What is an Exception ?

10 Answers  


Write a function to print Fibonacci series and Tribonacci series?

0 Answers   Hexaware,


What is anagram in java?

0 Answers  


Categories