Vivek Verma has Published 113 Articles

How to find the unicode category for a given character in Java?

Vivek Verma

Vivek Verma

Updated on 14-May-2025 14:12:22

5K+ Views

A Character class is a subclass of the class named Object, and it wraps a value of the primitive type char. An object of type Character contains a single field whose type is char. Unicode Category of a Character In Java, the Unicode category of a character refers to the ... Read More

How can we avoid a deadlock in Java?

Vivek Verma

Vivek Verma

Updated on 14-May-2025 14:07:06

5K+ Views

This article explains several strategies to avoid deadlock in Java, including a brief introduction to deadlock, strategies, and respective examples. Deadlock in Java In case of multi-threading, a deadlock is a programming situation where two or more threads are holding resources needed by other threads and are blocked forever, waiting ... Read More

Can we define multiple methods in a class with the same name in Java?

Vivek Verma

Vivek Verma

Updated on 14-May-2025 13:11:32

8K+ Views

Yes, we can define multiple methods in a class with the same name. But if we have two methods with the same name, the compiler should be able to differentiate between the two methods. Therefore, in Java, "we can define multiple methods" with the same name in a single class, as ... Read More

How can we sort a string without using predefined methods in Java?

Vivek Verma

Vivek Verma

Updated on 14-May-2025 12:39:37

7K+ Views

The java.lang.String class represents an immutable sequence of characters and cannot be changed once created. We need to instantiate this class or assign values directly to its literal to create a string in Java. The String class does not provide any built-in method to sort the contents of a string. ... Read More

When to call the Thread.run() instead of Thread.start() in Java?

Vivek Verma

Vivek Verma

Updated on 14-May-2025 12:15:29

2K+ Views

This article will briefly discuss the run() and start() methods, and also explain when to call run() instead of the start() method. Calling run() Method Instead of start() Usually, to execute a thread, we will call the start() method, and the start method calls run() implicitly, and the contents of ... Read More

How can we print all the capital letters of a given string in Java?

Vivek Verma

Vivek Verma

Updated on 14-May-2025 11:57:53

6K+ Views

The Character class is a subclass of the Object class, and it wraps a value of the primitive type char in an object. An object of type Character class contains a single field whose type is char. We can print all the capital letters of a given string using the ... Read More

How to check the memory used by a program in Java?

Vivek Verma

Vivek Verma

Updated on 14-May-2025 11:18:07

2K+ Views

This article will discuss "how to check the memory used by a program" in Java, including a brief introduction of the process for calculation and an appropriate example that correctly checks the memory usage by the program. Understanding Memory Usage in Java Programs A Java code that takes a long ... Read More

How to print the maximum occurred character of a string in Java?

Vivek Verma

Vivek Verma

Updated on 08-May-2025 16:34:12

647 Views

A String class can be used to represent character strings; all the string literals in Java programs are implemented as instances of the String Class. In Java, Strings are constants and their values cannot be changed (immutable) once declared.Printing Maximum Occurred Character The maximum occurring character of a string refers ... Read More

Importance of join() method in Java?

Vivek Verma

Vivek Verma

Updated on 08-May-2025 14:06:51

3K+ Views

The join() Method In Java, a join() is a final method of the Thread class, and it can be used to join the start of a thread's execution to the end of another thread's execution so that a thread will not start running until another thread has ended. If the join() ... Read More

How to print the first character of each word in a String in Java?

Vivek Verma

Vivek Verma

Updated on 05-May-2025 15:10:03

7K+ Views

This article will discuss how to print the first character of each word in a given string. For example, if we have the string "Hello John", the output should be H J. In Java, the String class is used to represent character strings. All string literals in a Java program ... Read More

Advertisements