Function to remove element from an array
The methodname sbSample doesn't tell anything about what the method is doing and this will make debugging the code very hard if not impossible.  

You should leave your methodparameters some space to breathe so int a[],int i should be int a[], int i. The same is true for variables and operators.  

Comments should tell the reader of the code why something is done in the way it is done. Stating the obvious what is done is only adding noise to the code and should be removed. Let the code itself tell what is done by using meaningful names for classes, methods and variables.  

This method is doing to much hence it is breaking the single responsibility principle. It is "deleting" array elements and displaying the resulting array values.   

If the source array has 10 elements and 3 of them have the value which you want to delete, the resulting array still has 10 elements which is somehow strange. Deleting means IMO that the size of the array should shrink afterwards. How about using an ArrayList&lt;T&gt; adding the items which aren't satisfying the search condition and later call toArray() to return the resulting array ?