1) What is an exception in java?
2) State some situations where exceptions may arise in java?
2) What is an error in java?
3) Difference between exception and error in java?
4) Explain java exception hierarchy?
5) What is exception handling in java and benefits of exception handling?
1) What is a webservice?
2) What are the advantages of webservices?
3) What are different types of Webservices?
This tutorial explains about how to print duplicate characters with number of occurences.For example take input as “java” we should display output as “a : 2”.
This is one of the important coding interview question on Strings.If we take input as “sandeep” it should print output as “sandep” removing duplicate character ‘e’.If we take input as “java” it should print output as “jav” removing character ‘a’ as it is duplicate.
Differences between Arraylist and linkedlist in java?
An arraylist is an object that can store other objects including enums.
An arraylist is internally implemented using array data structure.
Arraylist is in java.util package.
Arraylist can store only objects.
Index is used to access objects inside arraylist
Arraylist is dynamically resized once the list is full.
When an arraylist is created it is created with default capacity 10.
Differences between arrays and arraylist in java?
A java array is a container which holds fixed number of values which are of same type.
A java array is an object.
The values in array are accesed by using index.
An array is an area of memory in heap.
Arrays are used to store both primitives and objects.
What is method hiding in java?
If we define static method in subclass with same signature as that of super class then we say that subclass static method hides that of super class.
Redefining super class static method with same signature in subclass is called method hiding. Continue reading