Describe string intern() methodology
Answer / Md Aslam Khan
The String.intern() method returns the canonical (or unique) representation of a given string. Once created, this shared representation is cached and any subsequent calls to String.intern() for the same string will return the cached representation. This method is often used when performance is critical as it reduces memory usage by avoiding unnecessary duplicate strings.
| Is This Answer Correct ? | 0 Yes | 0 No |
if arraylist size is increased from initial size what is the size of arraylist...suppose initial is 100 , if i add 101 element what is the size...
If try block is successfully executed, Then Is Finally block executed?
hi to all,i have a question on static block. i saved below as test.java class test extends a { static { System.out.println("test static"); } public static void main(String []dfs) { } } class a { static { System.out.println("a static"); } public static void main(String []asdf) { } } o/p as static test static but if i change base class as test class then class test { static { System.out.println("test static"); } public static void main(String []dfs) { } } class a extends test { static { System.out.println("a static"); } public static void main(String []asdf) { } } o/p test static explain me why "a static" wasn't print in second code when it is in derived class
I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?
What does bitwise or mean?
What is static and a non-static inner class?
How do you read and print a string in java?
How to perform bubble sort in java?
Can we write a class without main method in java?
What are keywords give examples?
What is null in java?
What's the access scope of protected access specifier?