Introduction LinkedHashMap is one of the most popular map implementations in Java, it extends the HashMap class and implements Map implementation of Java Collection utilities. It provides a very powerful...
While learning Java, you all must have come across these terms of TreeMap, hashmap, Linkedhashmaps also have used these data structures and their implementations in your programs. But what is...
Check if a given number is palindrome or not. Ans. A palindrome is a number which is when reversed give the same number. We find the reverse and check whether...
1. Write a program to swap two numbers in Java. Ans. Two ways to do this -with third variable and without third variable. public static void swapNumberswithtemp(int a, int b)...
What is immutable object? Ans. Immutable objects can be created of immutable classes. Objects of these class cannot be modified. So whenever we try to change or modify these objects...
1. Write a program in Java to reverse a number. Ans. Extract each digit and keep multiplying with 10 and adding the remainder. static int REV(int n){ long RevNumber=0; while...
Java is a highly well-known object-oriented programming language that was developed in 1972, but it has continued to be one of the most crucial languages for decades. As its competitors...