Yearly Archives

Default array values in Java

If we don’t assign values to array elements, and try to access them, compiler does not produce error as...

Default array values in Java

If we don’t assign values to array elements, and try to access them, compiler does not produce error as...

Remove leading and trailing spaces

Given a string, remove all the leading and trailing spaces from the string and return it. Examples: Input :...

Remove leading and trailing spaces

Given a string, remove all the leading and trailing spaces from the string and return it. Examples: Input :...

Remove Leading Zeros From String in Java

Given a string of digits, remove leading zeros from it. Examples: Input : 00000123569 Output : 123569 Input :...

Remove Leading Zeros From String in Java

Given a string of digits, remove leading zeros from it. Examples: Input : 00000123569 Output : 123569 Input :...

String vs StringBuilder vs StringBuffer in Java

string-reverse Recommended: Please try your approach on {IDE} first, before moving on to the solution. Prerequisite: String vs StringBuilder...

String vs StringBuilder vs StringBuffer in Java

string-reverse Recommended: Please try your approach on {IDE} first, before moving on to the solution. Prerequisite: String vs StringBuilder...

How to Initialize and Compare Strings in Java?

Initializing Strings in Java 1. Direct Initialization(String Constant) : In this method, a String constant object will be created...

How to Initialize and Compare Strings in Java?

Initializing Strings in Java 1. Direct Initialization(String Constant) : In this method, a String constant object will be created...