Capitalizing First Character in String in java:
To capitalize first character in String we use Stringutils capitalize method.
capitalize method accepts string and returns capitalized string in return.
Syntax : public static String capitalize(final String str) ; Continue reading
Repeating String n number of times with single line:
To repeat the string n number of times with a single line we can use Stringutils repeat method.
Syntax: public static String repeat(final String str, final String separator, final int repeat)
Repeat method accepts three arguments. Continue reading
Removing last characters from String in java
To remove last characters from String in java we have a method removeEnd in Stringutils class.
removeEnd() method removes last characters from String in java. Continue reading
Delete characters from starting of the string in java
To remove some characters from starting of the string we have removeStart() method in StringUtils class.
removeStart() method removes only some characters at the start of the string and returns remaining string.Removes only characters from start of the string only if characters are found. Continue reading
Removing white spaces from String in java
To remove whitespaces from String in java we have a deleteWhitespace() method in String Class. Continue reading
Joining array of Strings with separator in java:
To join array of Strings in java with separator we have a join method in Stringutils class. Continue reading
304)Can a boolean primitive value be converted to any other primitive type in java?
No Boolean primitive cannot be assign to anyother value in java because in boolean type variables we can store only true or false which are literals but not strings.
305) What is autoboxing and autounboxing?
1) Java 1.5 introduced a new mechanism called autoboxing and unboxing.
2) Autoboxing is automatic conversion of primitive type to its corresponding wrapper class objects.
3) Autounboxing is the automatic conversion of wrapper object to its corresponding primitive type.
Example : conversion of int primitive to Integer wrapper object.
Integer a=i; Continue reading
300)What is typeconversion?
Some times in real world scenarios we need to store one type of data in to other such as storing numbers in string objects etc.In such case we need to convert one type of data to another.For example converting integer data to float and viceversa. Continue reading
To join mutliple strings in java we can use concatenation operator + or we can use third party api like stringutils.As most of the people know how to use concatenation operator we will join multiple Strings using StringUtils join method. Continue reading
Splitting String by uppercase in java:
To split a string by uppercase use splitByCharacterTypeCamelCase method in Stringutil class. Continue reading