Core java Interview Question and Answers By Vivek Part -7

Опубликовано: 13 Май 2026
на канале: ITSP
27
2

#Java #StringClass #Immutable #StringImmutability #StringObjects #StringCreation #StringInterning #StringLiteralConcept #StringVsStringBuffer #ImmutableClass #ToStringMethod #StringEfficiency #StringProcessing #ExceptionHandling #CheckedVsUncheckedExceptions #ErrorBaseClass #ExceptionBaseClass #FinallyBlock #FinallyBlockUsage #FinallyWithoutCatch #TryCatchBlock #FinallyBlockExecution #ReThrowException

121. What is the meaning of Immutable in the context of String class in
Java?
122.Why a String object is considered immutable in java?
123.How many objects does following code create?
124.How many ways are there in Java to create a String object?
125.How many objects does following code create?
126.What is String interning?
127.Why Java uses String literal concept?
128.What is the basic difference between a String and StringBuffer
object?
129.How will you create an immutable class in Java?
130.What is the use of toString() method in java ?
131. Arrange the three classes String, StringBuffer and StringBuilder in
the order of efficiency for String processing operations?
Exception Handling
132.What is Exception Handling in Java?
133.In Java, what are the differences between a Checked and
Unchecked?
134.What is the base class for Error and Exception classes in Java?
135.What is a finally block in Java?
136.What is the use of finally block in Java?
137.Can we create a finally block without creating a catch block?
138.Do we have to always put a catch block after a try block?
139.In what scenarios, a finally block will not be executed?
140.Can we re-throw an Exception in Java