Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
Liquid Web Managed Dedicated Server: RAID 1 SSD with 16GB of RAM minimum! 24/7 On-Site Heroic Support! Industry-Leading SLA!

BlueHost Web Hosting

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

getflywheel wordpress hosting


Liquid Web Cloud VPS Hosting

8,365 questions

11,625 answers

573 users

How to use string in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {
  
    public static void main(String[] args) {
         
            String s1 = "java programming";
            int n = 13;
		
            String s2 = s1 + " " + n;
            
            String s3 = s2.substring(3, 8);
            String s4 = "c# programming";
            String s5 = s2 + s4;
		
            System.out.println("s1 = " + s1);
            System.out.println("s2 = " + s2);
            System.out.println("s3 = " + s3);
            System.out.println("s4 = " + s4);
            System.out.println("s5 = " + s5);
		
            int b = 20;
		
            String s6 = n + b + " = sum";
            String s7 = "sum = " + n + b;
		
            System.out.println("s6 : " + s6);
            System.out.println("s7 : " + s7);
    }
}
    
/*
run:
   
s1 = java programming
s2 = java programming 13
s3 = a pro
s4 = c# programming
s5 = java programming 13c# programming
s6 : 33 = sum
s7 : sum = 1320
    
*/

 




answered Jun 28, 2017 by avibootz
...