- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Raja has Published 760 Articles
raja
13K+ Views
The threads can communicate with each other through wait(), notify() and notifyAll() methods in Java. These are final methods defined in the Object class and can be called only from within a synchronized context. The wait() method causes the current thread to wait until another thread invokes the notify() or ... Read More
raja
404 Views
No, we cannot call the wait() method without acquiring the lock. In Java, once the lock has been acquired then we need to call wait() method (with timeout or without timeout) on that object. If we are trying to call the wait() method without acquiring a lock, it can throw ... Read More
raja
3K+ Views
A join() is a final method of 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() method is called on a ... Read More
raja
4K+ Views
The sleep() method is a static method of Thread class and it makes the thread sleep/stop working for a specific amount of time. The sleep() method throws an InterruptedException if a thread is interrupted by other threads, that means Thread.sleep() method must be enclosed within the try and catch blocks ... Read More
raja
1K+ Views
For a long-running java code, which makes heavy use of dynamic memory, we may end up with Out-Of-Memory errors due to a memory shortage of the heap space. In the below program, we can test the free java heap space used by a program. If the heap space is used more ... Read More
raja
353 Views
A String class can be used to represent the character strings, all the string literals in Java programs are implemented as an instance of the String Class. The Strings are constants and their values cannot be changed (immutable) once created. In the below program, we can print the maximum occurred character ... Read More
raja
4K+ 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 class contains a single field whose type is char. We can print all the uppercase letters by iterating the characters of a string in ... Read More
raja
2K+ Views
When we call the start() method on a thread it causes the thread to begin execution and run() method of a thread is called by the Java Virtual Machine(JVM). If we call directly the run() method, it will be treated as a normal overridden method of a thread class (or runnable ... Read More
raja
4K+ Views
A String is an object that represents an immutable sequence of characters and cannot be changed once created. The java.lang.String class can be used to create a string object. In the below program, we can sort the characters of a string without using any predefined methods of String class in Java. Example public ... Read More
raja
7K+ Views
Yes, we can define multiple methods in a class with the same name but with different types of parameters. Which method is to get invoked will depend upon the parameters passed. In the below example, we have defined three display methods with the same name but with different parameters. Depending on ... Read More