11. What are the important
methods of StringTokenizer?
hasMoreTokens()
nextToken()
countToken()
which will use to display string which get split.
12. Is ++ operator is thread-safe in Java?
No .Its because it involve multiple instructions like reading a value, incrementing it and storing it back into memory which may lead to overlapping between multiple threads.
No .Its because it involve multiple instructions like reading a value, incrementing it and storing it back into memory which may lead to overlapping between multiple threads.
13. What is the size of int in 64-bit JVM?
The size of an int variable is constant in Java irrespective of platform.
The size of an int variable is constant in Java irrespective of platform.
Its size will always be 32 bits.
14. LinkedList in Java is doubly or singly
linked list?
It's a doubly linked list.
It's a doubly linked list.
15. Does constructor return
any value?
Yes, implicitly it returns
current instance.
No comments:
Post a Comment