Sunday, August 5, 2018

Java Interview Questions


1. When parseInt () method can be used?
This method is used to get the primitive data type of a certain String.
2. Why is String class considered immutable?
The String class is immutable, so that once it is created a String object cannot be changed. Since String is immutable it can safely be shared between many threads, which is considered very important for multithreaded programming.
3. Why is StringBuffer called mutable?
The String class is considered as immutable, so that once it is created a String object cannot be changed. If there is a necessity to make a lot of modifications to Strings of characters then StringBuffer should be used.


No comments:

Post a Comment

Which Python course is best for beginners?

Level Up Your Python Prowess: Newbie Ninjas: Don't fret, little grasshoppers! Courses like "Learn Python 3" on Codecade...