60 likes | 109 Views
Learn Core Java Training in Chennai from Accord which is the best java training institute in Chennai. Be job ready with our certification courses. Register with us today if you want to learn either just the basics and the core of java or J2EE which is advanced java training as we provide you with the best java courses in Chennai.
E N D
JAVA TRAINING INSTITUTE in CHENNAI http://www.accordittraining.com/
What is a String in Java In java, string is an immutable object which means it is constant and can cannot be changed once it has been created.
Creating a String There are two ways to create a String in Java • String literal • Using new keyword
String literal In java, Strings can be created like this: Assigning a String literal to a String instance: String str1 = "Welcome"; String str2 = "Welcome";
Using New Keyword Compiler only created one object and made both of the literals to point the same object. To overcome that approach we can create strings like this: String str1 = new String("Welcome"); String str2 = new String("Welcome");
Contact US www.accordittraining.com CALL US +91 9940289059 EMAIL: enquiry@accordittraining.com