Showing posts with label String Concatenation Operators. Show all posts
Showing posts with label String Concatenation Operators. Show all posts

Java String Concatenation Operators / Chapter -3 /Operator & Assignments



java string


 Java String Concatenation Operator




  1. This (+) is the only overloaded operator in java.Sometimes it acts as "Arithmetic operators" and Sometimes it acts as "String Concatenation Operators".

  2. If both arguments are number type then it acts as "Arithmetic Addition Operator".

  3. If at least one argument is String type then (+)operators act as "String Concatenation Operators".



example 1:-
String a="javabychetan";
int b=10,c=20,d=30;
System.out.println(a+b+c+d);        o/p is              javabychetan102030
System.out.println(b+c+d+a);       o/p is               60javabychetan
System.out.println(b+c+a+d);       o/p is               30javabychetan30
System.out.println(b+a+c+d);       o/p is               10javabychetan2030

  •   explanation of the first System.out.println(a+b+c+d);






java string

javabychetan.com



Java - String Concatenation Operators / Chapter -3 /Operator & Assignments

javabychetan.blogspot.com

  1. This (+) is the only overloaded operator in java.Sometimes it acts as "Arithmetic operators" and Sometimes it acts as "String Concatenation Operators".
  2. If both arguments are number  type then it acts as "Arithmetic Addition Operator".
  3. If at least one argument is String type then (+)operators act as "String Concatenation Operators".
example 1:-
                String a="javabychetan";
                int b=10,c=20,d=30;
               System.out.println(a+b+c+d);        o/p is              javabychetan102030
               System.out.println(b+c+d+a);       o/p is               60javabychetan
               System.out.println(b+c+a+d);       o/p is               30javabychetan30
               System.out.println(b+a+c+d);       o/p is               10javabychetan2030
       
  •                explanation of the first System.out.println(a+b+c+d);
           
javabychetan.blogspot.com

Flipkart End Of Season Sale






© Copyright 2017 Javabychetan.blogspot.com