- 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 131 Articles
Rishi Raj
281 Views
A single action can be performed in multiple ways using the concept of polymorphism. Run-time polymorphism can be performed by method overriding. The overridden method in this is resolved at compile time.A program that demonstrates run-time polymorphism in Java is given as follows:Example Live Democlass Animal { void sound() { ... Read More
Rishi Raj
3K+ Views
The import statement can be used to import an entire package or sometimes import certain classes and interfaces inside the package. The import statement is written before the class definition and after the package statement(if there is any). Also, the import statement is optional.A program that demonstrates this in Java ... Read More
Rishi Raj
75 Views
A single element in the Vector can be removed using the java.util.Vector.remove() method. This method removes the element at the specified index in the Vector. It returns the element that was removed. Also after the element is removed from the specified index, the rest of the Vector elements are shifted ... Read More
Rishi Raj
4K+ Views
The factorial of any non-negative integer is basically the product of all the integers that are smaller than or equal to it. The factorial can be obtained using a recursive method.A program that demonstrates this is given as follows:Example Live Demopublic class Demo { public static long fact(long n) { ... Read More
Rishi Raj
434 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
157 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
654 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
7K+ 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
423 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
473 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
To Continue Learning Please Login
Login with Google