Java - String PowerPoint PPT Presentation

presentation player overlay
About This Presentation
Transcript and Presenter's Notes

Title: Java - String


1
JAVA TRAINING INSTITUTE in CHENNAI
  • http//www.accordittraining.com/

2
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. 

3
Creating a String
  • There are two ways to create a String in Java
  • String literal
  • Using new keyword

4
String literal
  • In java, Strings can be created like this
    Assigning a String literal to a String instance

String str1 "Welcome" String str2 "Welcome"
5
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")
6
Contact US
www.accordittraining.com
 CALL US 91 9940289059
EMAIL enquiry_at_accordittraining.com
Write a Comment
User Comments (0)
About PowerShow.com