Wednesday, 30 March 2016

HOW TO CONCATENATE IN JAVA

Hello Reader This Is A First Program In Java To Print A Given  Massage . Here Remember One Thing Java Is Very Case Sensitive Language  So Be Carefully

TIPS:- 

1. Import All Necessary Header File Or Library Or Package What Ever You Called Them .

2.Class Name Should Contain Only Alphabet ( Upper & Lower Case ) Or _ ( Underscore )

3.Class Name And Java Program Name Should Be Shame Name Ex: Class hello And When You Save  The Program It Should Be hello.java 

4.Use Best Editor For Write A Java Program Instead Of NOTEPAD You Can Use NOTEPAD++ or SUBLIME TEXT

5.If  You Need Any Help Our Expert Always With You Here Your Java Expert Is "Prashant Chaturvedi  Sir"


Concatenation Concept-

     

              +

Addition                        Concatenation 

10+24                          "JAVA" + "Developer"
25+30                          "JAVA" + 20


Program:-

class Program3
{
public static void main(String[] args)
{
System.out.println(20+20);
System.out.println("java "+"developer");
System.out.println("Number is"+20);
System.out.println("Number is"+20+20);
System.out.println("Number is"+(20+20));
System.out.println("20+ is the Number");
System.out.println(20+20+"is the Number");
}
 }

Output:-

www.programmingwithbasics.com

1 comment:
Write comments

Recommended Posts × +