Java Articles

Page 435 of 450

Regular Expressions syntax in Java Regex

Jai Janardhan
Jai Janardhan
Updated on 30-Jul-2019 313 Views

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

Read More

What is the package for String Class in Java?

Jai Janardhan
Jai Janardhan
Updated on 30-Jul-2019 5K+ Views

String class belongs to the java.lang package.

Read More

Is StringBuffer final in Java?

Anjana
Anjana
Updated on 30-Jul-2019 767 Views

Yes, StringBuffer class is final Java. We cannot override this class.

Read More

Why we do not import a package while we use any string function?

Sai Nath
Sai Nath
Updated on 30-Jul-2019 979 Views

The String class belongs to the java.lang package. This is the default package of the Java language therefore it is not mandatory to import it to use its classes.

Read More

Immutable String in Java

Sai Nath
Sai Nath
Updated on 30-Jul-2019 822 Views

In Java immutable objects are those whose data can’t be changed or modified (once modified). String class is immutable i.e. once we create a String object its data cannot be modified.

Read More

What is static import in Java?

Krantik Chavan
Krantik Chavan
Updated on 30-Jul-2019 813 Views

As import statement allows to use a class without its package qualification, static import allows to access the static members of a class without class qualifications. For Example, to access the static methods you need to call the using class name − Math.sqrt(169); But, using static import you can access the static methods directly. Example Live Demo import static java.lang.Math.*; public class Sample{ public static void main(String args[]){ System.out.println(sqrt(169)); } } Output 13.0

Read More

What is the difference between Java and Core Java?

radhakrishna
radhakrishna
Updated on 30-Jul-2019 1K+ Views

Java is a programming language, whereas Core Java is a computing platform. Java Platform Standard Edition is Core Java, which is also called Java SE. The following are the computing following supported by Java, which also has Core Java as its part:Java SE Java Standard Edition used to develop desktop applications. A well-known implementation of Java SE is the Java Development Kit (JDK).Java EE Java Enterprise Edition i.e. Java 2 Platform, Enterprise Edition or J2EE. Java EE is used for applications running on servers. Java ME Java Micro Edition is used for applications running on mobile phones.Java SE is the Standard Edition and also ...

Read More

Can a Vector contain heterogeneous objects in Java?

Ramu Prasad
Ramu Prasad
Updated on 30-Jul-2019 1K+ Views

Since a vector stores elements in the form of objects, you can store objects of various types (heterogeneous) in it.Example:import java.util.*; class Demo{} public class VectorSample {    public static void main(String args[]) {       Demo obj = new Demo();       Vector v = new Vector(3, 2);       System.out.println("Initial size: " + v.size());       System.out.println("Initial capacity: " + v.capacity());       v.addElement(new Integer(1));       v.addElement(new String("krishna"));       v.addElement(new Float(3.5f));       v.addElement(obj);       System.out.println("Capacity after four additions: " + v.capacity());    } }

Read More

What does the method add(E element) do in java?

Nikitha N
Nikitha N
Updated on 30-Jul-2019 507 Views

The add(E e) method of the java.util.ArrayList class appends the specified element E to the end of the list.Example:import java.util.ArrayList; public class ArrayListDemo {    public static void main(String[] args) {       ArrayList arrlist = new ArrayList(5);       arrlist.add(15);       arrlist.add(20);       arrlist.add(25);       for (Integer number : arrlist) {          System.out.println("Number = " + number);       }    } }Output:Number = 15 Number = 20 Number = 25

Read More
Showing 4341–4350 of 4,496 articles
« Prev 1 433 434 435 436 437 450 Next »
Advertisements