Core Java Interview questions


Total available count: 646
Subject - Java Technologies
Subsubject - Core Java

Why String is immutable in java?

 There are several reasons for string is immutable.one of the main reason is security issue,generally parameters are        typically represented as String in network connections, database connection urls, usernames/passwords etc.  If it were mutable, these parameters could be easily changed.

 




Next 5 interview question(s)

1

What is the difference between creating string object using string literal and using new keyword in java?

2

How can you create String object using new keyword with example?

3

 Will it create two objects If two strings have same value using String literal in java?

4

How can you create String object using String literal with example?

5

In how many ways String object can be created in java?