Found 9321 Articles for Object Oriented Programming

How To Check Whether a Number is Tech Number or Not in Java?

Mr. Satyabrata
Updated on 09-Dec-2022 10:27:19

6K+ Views

A number is said to be a tech number, when an even digit number is divided into exactly two parts and the square value of the sum of those two numbers is equal to the original number. For more clarification, we take a number which has even digits. After that, divide it into two parts and add two parts. After getting the sum value, we calculate the square of it. Now we compare both the calculated square value and the original/input number. If both are same then we can say that the input number is a tech number otherwise ... Read More

How To Check Whether a Number is Tcefrep Number or Not in Java?

Mr. Satyabrata
Updated on 09-Dec-2022 10:24:06

361 Views

A number is said to be a Tcefrep number, if the reverse of that number is equal to the sum of the proper divisors of the original number. For more clarification, we find the sum of the divisors of a number and find the reverse of the original number. If both the sum value and the reverse of the given number are the same then we can say that the given number is a Tcefrep number. Some examples of Tcefrep numbers are: 6, 498906, 20671542 ... etc. In this article, we will see how to check if a ... Read More

How To Check Whether a Number is Strontio Number or Not in Java?

Mr. Satyabrata
Updated on 09-Dec-2022 10:19:14

2K+ Views

A number is said to be a Strontio number, if we multiply 2 with a four-digit number then in the resultant number the tens place and hundreds place digits are the same. In simple terms, Strontio numbers are basically four-digit numbers. When we multiply 2 with it, it results in a number whose tens place and hundred places are exactly the same. Some examples of Strontio numbers are- 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 1001 ... etc. In this article, we will see how to check if a number is a strontio number by using Java ... Read More

How To Check Whether a Number is Pointer Prime Number or Not in Java?

Mr. Satyabrata
Updated on 09-Dec-2022 10:17:02

580 Views

A number is said to be a pointer prime number, if the sum of the product value of digits and the original prime number results in the next prime number. For more clarification, we take a prime number and multiply the digits with each other and add that multiplication value with the original number. After that if we get another prime number which is next to the original prime number. Then we can say that the number is a pointer prime number. Some examples of pointer prime numbers are: 23, 61, 1123, 1231 ... etc. In this article, ... Read More

How To Check Whether a Number is a Narcissistic Number or Not in Java?

Mr. Satyabrata
Updated on 09-Dec-2022 10:12:36

2K+ Views

A number is said to be a narcissistic number, if the addition value of each digit raised to the power of numbers of digits available in the original number is equal to the original number. For more clarification, if the original number has ‘n’ number of digits, first we have to calculate the nth power of each digit. Then add those value and check if that calculated value and original number both are same then the original number is called as narcissistic number. Some examples of narcissistic numbers are: 153, 8208, 4210818, ... etc. In this article, we will ... Read More

How To Check Whether a Number is a Mersenne Number or Not in Java?

Mr. Satyabrata
Updated on 09-Dec-2022 10:08:10

1K+ Views

A prime number is said to be a Mersenne number, if the number satisfy the expression of M(n)= 2n-1, where ‘n’ is an integer. Let, ‘n’ is an integer. If 2n -1 is equal to the prime number, then that number is known as mersenne number Some examples of Mersenne numbers are: 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095 ... etc In this article, we will see how to check if a number is a Mersenne number by using Java programming language. To show you some instances Instance-1 Input number is 15. Let’s check ... Read More

How To Check Whether a Number is an Empire Number or Not in Java?

Mr. Satyabrata
Updated on 09-Dec-2022 10:04:04

221 Views

A number is said to be an empire number, if after reversing a prime number we get another prime number. In this article, we will see how to check if a number is an empire number by using Java programming language. To show you some instances Instance-1 Input number is 13. Let’s check it by using the logic of the Empire number. 13 is a prime number. If we reverse 13, then we get = 31 As we notice here both the reversed number and input number both are prime numbers. Hence, 13 is an empire number. Instance-2 ... Read More

Different methods to append a single character to a string or char array in Java

Janani Jaganathan
Updated on 25-Aug-2022 09:06:21

671 Views

Have you ever faced the situation of extending a string or char array? If you haven't yet, you might probably encounter this situation in the future. It is a common practice to append a single character to a string or char array in Java. The significant difference between a string array and a char array is that a string array is a sequence of characters, and a char array is a sequence of collection of data type char. String array runs as a single entity, whereas char array runs as a separate entity. In this blog, we will look ... Read More

Top Resources for Java Interview Questions

Janani Jaganathan
Updated on 25-Aug-2022 09:06:56

284 Views

Are you a fresher or final-year graduate looking to start your career as a Java developer? Have you already landed as a java developer and are looking to prepare for the next company? If you say "Yes" to any of these questions, then you are at the right place. In this article, you will come across the top resources and websites that will help you to prepare and do well in java programming interviews. The list includes popular online platforms and websites like Tutorialspoint, StackOverflow, DZone, etc., where you can learn frequently asked java questions in top companies' interviews and ... Read More

How to use List size() method in Java With Examples?

Mahesh Parahar
Updated on 27-May-2022 08:33:11

425 Views

The List interface extends the Collection interface and stores a sequence of elements. The List interface provides two methods to efficiently insert and remove multiple elements at an arbitrary point in the list. Unlike sets, list allows duplicate elements, and allows multiple null values if null value is allowed in the list.List interface size() can be used to get the count of elements currently present in the list. It always returns the count of currently present elements. You can check the latest size after adding/removing element(s) to the list.Syntaxint size()NotesReturns the number of elements in this list.If this list contains ... Read More

Advertisements