#34 What is String in Java

preview_player
Показать описание
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
Рекомендации по теме
Комментарии
Автор

public class Main{
public static void main(String[] args) {

String name = "Murdoc";
System.out.println(name);


System.out.println(name.substring(1, 3));




programs"));

}
}

kvelez
Автор

@Telusko Thanks for remaking videos...

darklord
Автор

hi sir i am your great friend 🙂🙂 But I have been suffering from a problem for some time.I have been learning java programming from watching your videos for almost four years.Should I learn or should I shift to another language? Because i want to be a freelancer🙂

monirkhan
Автор

so on 7:00, is String name = "navin"; just a simplified way of typing String name = new String("navin"); ? Do they both work the exact way and mean the same thing?

mrmansir
Автор

its showing when i click on definition // Failed to get sources. Instead, stub sources have been generated by the disassembler.
// Implementation of methods is unavailable.

akshay
Автор

String s = new String ("abc");
String S2 = "abc";

How many objects will be created in the heap memory?

hardwaregeek
Автор

can anyone tell me, when he clicks on the String keyword he is getting the String.class file how do i get it in my VS code also

vishwa
Автор

Why are you not updating VS Code? Please update VS Code.

puruagni
Автор

hi sir i am your great friend 🙂🙂 But I have been suffering from a problem for some time.I have been learning java programming from watching your videos for almost four years.Should I learn or should I shift to another language? Because i want to be a freelancer🙂

monirkhan
Автор

hi sir i am your great friend 🙂🙂 But I have been suffering from a problem for some time.I have been learning java programming from watching your videos for almost four years.Should I learn or should I shift to another language? Because i want to be a freelancer🙂

monirkhan
Автор

hi sir i am your great friend 🙂🙂 But I have been suffering from a problem for some time.I have been learning java programming from watching your videos for almost four years.Should I learn or should I shift to another language? Because i want to be a freelancer🙂

monirkhan
Автор

hi sir i am your great friend 🙂🙂 But I have been suffering from a problem for some time.I have been learning java programming from watching your videos for almost four years.Should I learn or should I shift to another language? Because i want to be a freelancer🙂

monirkhan