
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Maruthi Krishna has Published 870 Articles

Maruthi Krishna
130 Views
A String is a class in Java which stores a sequence of characters, it belongs to the java.lang package. Once you create a String object you cannot modify them (immutable).StorageAll String objects are stored in a separate memory location in the heap area known as, String Constant pool.Whenever you define ... Read More

Maruthi Krishna
14K+ Views
Strings are used to store a sequence of characters in Java, they are treated as objects. The String class of the java.lang package represents a String.You can create a String either by using the new keyword (like any other object) or, by assigning value to the literal (like any other ... Read More

Maruthi Krishna
168 Views
Since Java8 StringJoiner class is introduced this you can construct a sequence of characters separated by desired delimiter.Sr.NoConstructor & Description1StringJoiner(CharSequence delimiter)This constructor creates an empty (no characters) StringJoiner, just with a copy of the specified delimiter.2StringJoiner(CharSequence delimiter, CharSequence prefix, CharSequence suffix)This constructs a StringJoiner without characters.Methods of StringJoiner classadd() − ... Read More

Maruthi Krishna
2K+ Views
JSON or JavaScript Object Notation is a lightweight text-based open standard designed for human-readable data interchange. Conventions used by JSON are known to programmers, which include C, C++, Java, Python, Perl, etc.There are several Java libraries available to handle JSON objects. Google Gson is a simple Java-based library to serialize ... Read More

Maruthi Krishna
327 Views
You can convert a String to a character array either by copying each element of the String to an array or, using the toCharArray() method.Copying each elementGet the String to be converted.Create an empty character array with the length of the String.The charAt() method of the String class returns the ... Read More

Maruthi Krishna
235 Views
When you call a method at illegal or inappropriate time an IlleagalStateException is generated.For example, the remove() method of the ArrayList class removes the last element after calling the next() or previous methods.After removing the element at the current position you need to move to the next element to remove ... Read More

Maruthi Krishna
2K+ Views
A static block is a block of code with a static keyword. In general, these are used to initialize the static members. JVM executes static blocks before the main method at the time of class loading.Example Live Demopublic class MyClass { static{ System.out.println("Hello this is a static ... Read More

Maruthi Krishna
9K+ Views
Whenever an exception occurred in a loop the control gets out of the loop, by handling the exception the statements after the catch block in the method will get executed. But, the loop breaks.Example Live Demopublic class ExceptionInLoop{ public static void sampleMethod(){ String str[] = {"Mango", "Apple", ... Read More

Maruthi Krishna
1K+ Views
DescriptionWhen a piece of code in particular method throws an exception, and is handled using try-catch pair. If we are calling this method from another one and, the calling line is wrapped within try-catch pair. Now, how can I override the catch block by the catch block of the calling ... Read More

Maruthi Krishna
1K+ Views
There are several logging frame works available to log your data in to files. You can also define your own method.Example − Using I/O packageFollowing Java program has an array storing 5 integer values, we are letting the user to choose two elements from the array (indices of the elements) ... Read More