Filter interviews by
To find prime numbers in Java, iterate through numbers and check if they are divisible only by 1 and themselves.
Iterate through numbers from 2 to n
For each number, check if it is divisible only by 1 and itself
If it is, add it to the list of prime numbers
Top trending discussions
posted on 5 Aug 2024
HashMap is a data structure in Java that stores key-value pairs and allows for fast retrieval of values based on keys.
HashMap is part of the Java Collections framework.
It uses hashing to store and retrieve elements efficiently.
Each key in a HashMap must be unique.
Example: HashMap
WRITE A PROGRAM FOR FIBONACCI SERIES
STATIC vs FINAL - STATIC is used to define a class-level variable or method that can be accessed without creating an instance of the class. FINAL is used to define constants or prevent inheritance or method overriding.
STATIC variables and methods belong to the class itself, while FINAL variables cannot be changed once initialized.
STATIC variables are shared among all instances of a class, while FINAL variables are uniq...
Interview experience
Service Engineer
7
salaries
| ₹0.9 L/yr - ₹2 L/yr |
Accounts Manager
5
salaries
| ₹2.5 L/yr - ₹4.5 L/yr |
MIS Executive
5
salaries
| ₹1.2 L/yr - ₹1.8 L/yr |
Desktop Support Engineer
5
salaries
| ₹1.2 L/yr - ₹2.2 L/yr |
Business Development Manager
4
salaries
| ₹3 L/yr - ₹5 L/yr |
Karuna Management Services
Citylife Retail
RJ Corp
Major Brands