filmov
tv
#34 What is String in Java
![preview_player](https://i.ytimg.com/vi/cV-sOpOgof8/maxresdefault.jpg)
Показать описание
Check out our courses:
Coupon: TELUSKO10 (10% Discount)
Coupon: TELUSKO20 (20% Discount)
Udemy Courses:
For More Queries WhatsApp or Call on : +919008963671
In this lecture we are discussing:
1)What is String?
2)How to create String object?
3)hashcode
4)Concatenation operator
5)Some method of String class
#1
-- If you want to store character sequence e.g "shiva", "navin", "hyder" in
such cases we need character array or String (non-primitive data ) .
-- But Using String object it is easy to store sequence of character.
-- String is non primitive data-type and it is also a class.
String str="shiva";
#2
How to create String object?
-- using new operator String str=new String("shiva");
-- directly assigning String str="shiva"; put sequence of character inside a double quotes.
#3
What is hashcode?
-- hashcode is unique number for each object created in heap.
-- hashcode is used to identify object.
#4
Concatenation operator
-- + operator used to concatenate the String
String firstName="shiva";
String lastName="srivastava";
String fullName=firstName+lastName;
#5
some method used in String
a) int length() --to find the length of String
b) char charAt(int index) --to find character at particular index
Note: In array length is property while in String length() is method.
More Learning :
Donation:
PayPal Id : navinreddy20
Coupon: TELUSKO10 (10% Discount)
Coupon: TELUSKO20 (20% Discount)
Udemy Courses:
For More Queries WhatsApp or Call on : +919008963671
In this lecture we are discussing:
1)What is String?
2)How to create String object?
3)hashcode
4)Concatenation operator
5)Some method of String class
#1
-- If you want to store character sequence e.g "shiva", "navin", "hyder" in
such cases we need character array or String (non-primitive data ) .
-- But Using String object it is easy to store sequence of character.
-- String is non primitive data-type and it is also a class.
String str="shiva";
#2
How to create String object?
-- using new operator String str=new String("shiva");
-- directly assigning String str="shiva"; put sequence of character inside a double quotes.
#3
What is hashcode?
-- hashcode is unique number for each object created in heap.
-- hashcode is used to identify object.
#4
Concatenation operator
-- + operator used to concatenate the String
String firstName="shiva";
String lastName="srivastava";
String fullName=firstName+lastName;
#5
some method used in String
a) int length() --to find the length of String
b) char charAt(int index) --to find character at particular index
Note: In array length is property while in String length() is method.
More Learning :
Donation:
PayPal Id : navinreddy20
Комментарии