Vivek Verma has Published 113 Articles

How to check if a given character is a number/letter in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 17:05:50

54K+ Views

The Character class is a subclass of Object class and it wraps a value of the primitive type char in an object. An object of type Character contains a single field whose type is char. We can check whether the given character in a string is a number/letter by - ... Read More

Importance of return type in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 15:48:02

26K+ Views

A method in Java is a set of statements that can be reused in the program whenever we want. We can write a method once and call it multiple times. We can return values from a method; the datatype of the value we return is ... Read More

How To Check Whether a Number Is a Pronic Number or Not in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 15:19:37

7K+ Views

What is Pronic number? In mathematical terms, a Pronic number is a number that can be defined as the product of two consecutive integers. The Pronic number is in the form of n(n+1), where n is the integer. For example, the pronic numbers are 0, 2, 6, 12, 20, and ... Read More

How To Check If Three Points are Collinear in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 15:16:06

2K+ Views

In mathematical terms, three points are said to be collinear if all three points lie on a straight line. If the points do not lie on the same straight line, then they are not considered collinear points. Those three points represent coordinates on a plane: (x1, y1), (x2, y2), and (x3, ... Read More

What can cause the \"cannot find symbol\" error in Java?

Vivek Verma

Vivek Verma

Updated on 29-May-2025 05:39:49

12K+ Views

In Java, the cannot find symbol error occurs when we try to reference a variable that is not declared in the program or when we try to access a class that is not declared or imported.  Possible Causes of 'Cannot Find Symbol' Error Below is a list of some possible ... Read More

How to create a thread by using anonymous class in Java?

Vivek Verma

Vivek Verma

Updated on 27-May-2025 16:16:05

4K+ Views

This article will use an anonymous class to create a Thread in Java. An Anonymous class is a class that does not have a name. Thread in Java In Java, a Thread is a part of a program that can be executed independently. All Java programs have at least one ... Read More

What is the use of Object Cloning in Java?

Vivek Verma

Vivek Verma

Updated on 27-May-2025 15:54:32

2K+ Views

The article will explain the use of object cloning in Java and provide an appropriate example to clarify the problem. What is the Object Cloning in Java? In Java, object cloning is a way to create an exact copy of an object. We can use the clone() method provided by ... Read More

How many ways to call garbage collector (GC) in Java?

Vivek Verma

Vivek Verma

Updated on 27-May-2025 15:23:58

1K+ Views

This article explains the different ways of calling the garbage collector (GC) in Java. It also includes a brief introduction to garbage collection, various calling approaches, and relevant examples. Garbage Collection (GC) in Java In Java, the garbage collection is carried out by a daemon thread called the Garbage Collector ... Read More

What is the purpose of overriding a finalize() method in Java?

Vivek Verma

Vivek Verma

Updated on 27-May-2025 15:07:58

1K+ Views

In Java, overriding is a technique used to provide a specific implementation of a method that is already defined in a superclass (i.e., parent class), allowing a subclass (i.e., child class) to modify or extend the behavior of that method. Purpose of Overriding the finalize() Method The purpose of a ... Read More

How to convert between List and Array in Java?

Vivek Verma

Vivek Verma

Updated on 27-May-2025 14:31:46

1K+ Views

In Java, a List is an interface that represents an ordered collection of elements of the same type. You cannot directly create an object of the List interface, instead, you need to instantiate an ArrayList class or another class that implements the List interface.An array is a container that holds ... Read More

Previous 1 ... 5 6 7 8 9 ... 12 Next
Advertisements