Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Articles - Page 68 of 745
202 Views
The type of nested class that has no name is called an anonymous class. Before diving into a Java program to check if a given class is an anonymous class, we need to understand what is a nested class. Let's discuss this in detail. What is a Java Nested Class? A class created within another class in Java is called a nested class. We know that we cannot declare a Java class private, but we can define a nested class as private. There are two types of nested classes in Java: static and non-static. The static nested class is defined ... Read More
278 Views
The nested class that is defined inside the body of a method or within a loop, like for and if, is called a local inner class. Before making a Java program to check whether a given class is a local inner class or not, we need to understand the concept of nested classes first. Let's discuss this in detail. Nested Class When we create a class within another class, it is referred to as a nested class. The nested classes share the same scope. It allows the grouping of similar classes and encapsulation (wrapping of similar functionalities in a single unit). ... Read More
317 Views
Checking Eligibility of TPP Students in Java Consider the following table for eligibility criteria of different companies for appearing in interviews: CGPA ... Read More
859 Views
In this article, we will learn how to determine whether the installed JVM in your system is 32 bit or 64 bit. For this operation, we use the getProperty() method of System class, which helps in retrieving system property of specified argument. In computer architecture, 32 bit and 64 bit refers to those components that operate on data in 32-bit units and 64-bit units respectively. 64 bit machines are said to be faster and more secure compare to the 32 bit machines. What is JVM? JVM is Java Virtual Machine that is responsible for executing the byte code. It is ... Read More
2K+ Views
When the sum of factors of a given number (after discarding the given number) is equal to the number itself is called a perfect number. The sum of these divisors is known as the aliquot sum. Therefore, we can say that a number is perfect if it matches its aliquot sum. All known perfect numbers are even. Problem Statement In this article, we will create Java programs to check if a given number is perfect or not. Let's try to understand the given problem through some examples: Example Scenarios: Input: number = 496 Output: 496 is a perfect number ... Read More
299 Views
In Java, a collection is an object that allows us to group several numbers of objects as a single unit. The Collection interface is the root of the collection framework. We can perform various operations on collection like adding, removing, iterating, searching and retrieving objects. In this article, we will discuss Java programs to add data from the specified collection to the current collection with the help of addAll() method. Using addAll() method of Collection Interface The addAll() method of Collection interface adds data from a specified collection into current collection. It returns a boolean value, which is TRUE if the ... Read More
311 Views
The sum of the nth squares series is a form of arithmetic progression where the sum of squares is arranged in a sequence with the initial term as 1, and n being the total number of terms. 12 + 22 + 32 + ... + n2 In this article, we will discuss a Java program to add the nth square series. But, before that, let's see an example scenario: Example Scenario: Input: num = 6 Output: sum = 91 It will be calculated as: 12 + 22 + 32 + 42 + 52 + 62 = 1 ... Read More
511 Views
In Java, super refers to the parent class instance, and to inherit members of the super class to the child class, we use the extends keyword. Before writing a Java program to allocate and initialize super class members using a constructor, let's go through some concepts we are going to use in this article. What is Constructor? A Java constructor is a class member that initializes instance variables of a class. It is very similar to a method, but the difference is that methods can return a value, but a constructor does not return any value because it can't have any return ... Read More
4K+ Views
Arithmetic operators such as "+", "-", "*", and "/" are used to perform mathematical operations like addition, subtraction, multiplication, modulo, and division. We have added two numbers using the "+" operator, but in this article, we are going to learn a few Java programs that can add two numbers without using arithmetic operators. The following operators best serve this purpose: Increment operators (++) Bitwise operators ... Read More
892 Views
Inheritance is a concept that allows us to access the properties and behaviors of one class in another class. The class whose methods and member variables are inherited is known as the super class or parent class, and the class that inherits these methods and member variables is known as the child class or subclass. In Java, we use the extends keyword to inherit a class. Problem Statement Write Java programs that calculate interest for Fixed Deposits (FDs) and Recurring Deposits (RDs) using inheritance. The program should prompt the user to choose between FD and RD, enter the amount and duration, ... Read More