Jai Janardhan has Published 67 Articles

String compare by equals() method in Java

Jai Janardhan

Jai Janardhan

Updated on 30-Jul-2019 22:30:21

157 Views

The equals() method of the String class compares this string to the specified object. The result is true if and only if the argument is not null and is a String object that represents the same sequence of characters as this object.Example Live Demopublic class Test {    public static void ... Read More

remove null value from a String array in Java

Jai Janardhan

Jai Janardhan

Updated on 30-Jul-2019 22:30:21

4K+ Views

Following program creates an array with null values. Convert it a list with not-null values only and then get the array of that list.Exampleimport java.util.ArrayList; import java.util.List; public class Tester { public static void main(String[] args) { String[] array = {"I", ... Read More

Why java is both compiled and interpreted language.

Jai Janardhan

Jai Janardhan

Updated on 30-Jul-2019 22:30:21

797 Views

Yes, a java program is first compiled into bytecode which JRE can understand. ByteCode is then interpreted by the JVM making it as interpreted language.

Regular Expressions syntax in Java Regex

Jai Janardhan

Jai Janardhan

Updated on 30-Jul-2019 22:30:21

277 Views

Following is a simple program demonstrating how to use regular expression in Java. Java Regex Characters

What is the package for String Class in Java?

Jai Janardhan

Jai Janardhan

Updated on 30-Jul-2019 22:30:21

4K+ Views

String class belongs to the java.lang package.

What is string constant pool in Java?

Jai Janardhan

Jai Janardhan

Updated on 30-Jul-2019 22:30:21

844 Views

When you store a String asString str1 = "Hello";directly, then JVM creates a String object with the given value in a separate block of memory known as String constant pool.And whenever we try to create another String asString str2 = "Hello";JVM verifies whether any String object with the same value ... Read More

What are final, abstract, synchronized non-access modifiers in Java?

Jai Janardhan

Jai Janardhan

Updated on 30-Jul-2019 22:30:20

447 Views

The abstract keyword is used to declare methods abstract methods and abstract classes. Once a method is declared abstract we should not specify body for those. And once a class is declared abstract it cannot be instantiated. Example Live Demo abstract class Employee { private ... Read More

Previous 1 ... 3 4 5 6 7
Advertisements