- Trending Categories
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
Rishi Raj has Published 127 Articles
![Rishi Raj](https://www.tutorialspoint.com/assets/profiles/13777/profile/60_73169-1512647303.jpg)
Rishi Raj
453 Views
All the elements of a vector can be replaced by a specific element using java.util.Collections.fill() method. This method requires two parameters i.e. the Vector and the element that replaces all the elements in the Vector. No value is returned by the Collections.fill() method.A program that demonstrates this is given as ... Read More
![Rishi Raj](https://www.tutorialspoint.com/assets/profiles/13777/profile/60_73169-1512647303.jpg)
Rishi Raj
172 Views
The data members and methods of a class can be accessed from the same package or sub-classes in a different package if they are specified with the protected access modifier. The keyword protected is used to specify this modifier.A program that demonstrates the protected access modifier in Java is given ... Read More
![Rishi Raj](https://www.tutorialspoint.com/assets/profiles/13777/profile/60_73169-1512647303.jpg)
Rishi Raj
710 Views
A class is an abstract class if it contains at least one abstract method. It can contain other non-abstract methods as well. A class can be declared as abstract by using the abstract keyword. Also, an abstract class cannot be instantiated.A program that demonstrates an abstract class in Java is ... Read More
![Rishi Raj](https://www.tutorialspoint.com/assets/profiles/13777/profile/60_73169-1512647303.jpg)
Rishi Raj
8K+ Views
A list can be sorted in reverse order i.e. descending order using the java.util.Collections.sort() method. This method requires two parameters i.e. the list to be sorted and the Collections.reverseOrder() that reverses the order of an element collection using a Comparator.The ClassCastException is thrown by the Collections.sort() method if there are ... Read More
![Rishi Raj](https://www.tutorialspoint.com/assets/profiles/13777/profile/60_73169-1512647303.jpg)
Rishi Raj
463 Views
To send an e-mail using your Java Application is simple enough but to start with you should have JavaMail API and Java Activation Framework (JAF) installed on your machine. You can download latest version of JavaMail (Version 1.2) from Java's standard website. You can download latest version ... Read More
![Rishi Raj](https://www.tutorialspoint.com/assets/profiles/13777/profile/60_73169-1512647303.jpg)
Rishi Raj
518 Views
As we know that Hash map in Java does not maintain insertion order either by key or by order.Also it does not maintain any other order while adding entries to it. Now in order to sort a hash map according to the values mapped to its corresponding keys we first ... Read More
![Rishi Raj](https://www.tutorialspoint.com/assets/profiles/13777/profile/60_73169-1512647303.jpg)
Rishi Raj
499 Views
An immutable class object's properties cannot be modified after initialization. For example String is an immutable class in Java. We can create a immutable class by following the given rules below − Make class final − class should be final so that it cannot be extended. Make each field ... Read More
![Rishi Raj](https://www.tutorialspoint.com/assets/profiles/13777/profile/60_73169-1512647303.jpg)
Rishi Raj
242 Views
A Singleton pattern states that a class can have a single instance and multiple instances are not permitted to be created. For this purpose, we make the constructor of the class a private and return a instance via a static method. But using cloning, we can still create multiple instance ... Read More
![Rishi Raj](https://www.tutorialspoint.com/assets/profiles/13777/profile/60_73169-1512647303.jpg)
Rishi Raj
82 Views
The java.util.PriorityQueue class is an unbounded priority queue based on a priority heap.Following are the important points about PriorityQueue − The elements of the priority queue are ordered according to their natural ordering, or by a Comparator provided at queue construction time, depending on which constructor is used. A ... Read More
![Rishi Raj](https://www.tutorialspoint.com/assets/profiles/13777/profile/60_73169-1512647303.jpg)
Rishi Raj
1K+ Views
As we know the primary role of the constructor is to instantiate a class object now if we made the constructor as private then we restrict its calling to be only in defining a class and not in some other class. Now the singleton class in Java is defined as ... Read More