i
Northcorp
Software
Filter interviews by
JVM optimizes method calls using various techniques like inlining, escape analysis, and virtual method resolution.
JVM can inline methods by replacing the method call with the actual code, reducing overhead.
Escape analysis helps JVM determine if objects can be allocated on the stack instead of the heap.
Virtual method resolution optimizes method calls by caching the resolved method to avoid repeated lookups.
HashMap is not thread-safe, while ConcurrentHashMap is designed for concurrent access, allowing safe multi-threaded operations.
HashMap allows null keys and values; ConcurrentHashMap does not allow null keys or values.
HashMap is not synchronized, making it unsuitable for multi-threaded environments.
ConcurrentHashMap uses a lock striping technique, allowing multiple threads to read and write concurrently.
Example: In...
Inheritance in JAVA allows a class to inherit properties and behaviors from another class.
Allows a class to inherit fields and methods from another class
Promotes code reusability and reduces redundancy
Creates a parent-child relationship between classes
Example: class B extends class A
In Java, a child class can acquire properties of its parent class using inheritance, allowing code reuse and polymorphism.
Inheritance allows a subclass to inherit fields and methods from a superclass.
Use the 'extends' keyword to create a subclass. Example: 'class Dog extends Animal {}'
Access parent class properties using 'super' keyword. Example: 'super.methodName()'
Override parent class methods in the child class...
JVM stands for Java Virtual Machine, which is an abstract machine that enables a computer to run Java programs.
JVM is responsible for converting Java bytecode into machine code that can be executed by the computer's operating system.
It provides a platform-independent execution environment for Java programs.
JVM manages memory, handles garbage collection, and provides security features for Java applications.
Examples...
Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.
Abstract class can have constructors, member variables, and methods, while interface cannot.
A class can implement multiple interfaces but can only extend one abstract class.
Abstract classes are used to define a common behavior among subclasses, while interfaces are used to define a contract for classes to...
Java program to check if a number is prime
Create a function that takes an integer as input
Check if the number is less than 2, return false
Iterate from 2 to the square root of the number, check for divisibility
If the number is divisible by any number, return false
Otherwise, return true
The final keyword in Java is used to restrict the user from changing the value of a variable, making a method not overrideable, or preventing a class from being subclassed.
Final variables cannot be reassigned once initialized
Final methods cannot be overridden in subclasses
Final classes cannot be subclassed
Final parameters in a method cannot be modified within the method
Java related frameworks are tools that provide pre-written code to help developers build applications more efficiently.
Frameworks like Spring, Hibernate, and Struts are commonly used in Java development.
They provide libraries, APIs, and tools to simplify the development process.
Frameworks help with tasks like database access, security, and dependency injection.
Popular Java frameworks include Spring Boot, JavaServe...
JAVA is a high-level programming language known for its portability, security, and object-oriented features.
JAVA is platform-independent, meaning it can run on any device with a Java Virtual Machine (JVM)
It is object-oriented, allowing for modular and reusable code
JAVA is known for its security features, such as sandboxing and encryption
It is widely used for developing web applications, mobile apps, and enterprise...
Abstract classes can have both implemented and abstract methods, while interfaces can only have abstract methods. Abstract classes support single inheritance, interfaces support multiple inheritance.
Abstract classes can have both implemented and abstract methods, providing more flexibility in design.
Interfaces can only have abstract methods, promoting a more strict contract for implementing classes.
Abstract classes sup...
Method overloading is when multiple methods in a class have the same name but different parameters.
Allows multiple methods with the same name but different parameters in a class
Parameters can differ in number, type, or order
Compile-time polymorphism
Example: void print(int a) and void print(String s)
HashMap is not synchronized and not thread-safe, while ConcurrentHashMap is thread-safe and allows concurrent access.
HashMap is not synchronized, so it is not safe to use in a multi-threaded environment without external synchronization.
ConcurrentHashMap uses internal synchronization mechanisms to ensure thread safety, allowing multiple threads to access and modify it concurrently.
ConcurrentHashMap is designed to handle...
Develop, test, and maintain Java applications to ensure functionality and performance.
Write clean and efficient code following best practices
Test the application thoroughly to identify and fix bugs
Regularly update and maintain the application to meet changing requirements
JVM optimizes method calls using various techniques like inlining, escape analysis, and virtual method resolution.
JVM can inline methods by replacing the method call with the actual code, reducing overhead.
Escape analysis helps JVM determine if objects can be allocated on the stack instead of the heap.
Virtual method resolution optimizes method calls by caching the resolved method to avoid repeated lookups.
The '==' operator compares memory addresses of objects, while the .equals() method compares the content or value of objects.
Use '==' for comparing memory addresses of objects.
Use .equals() for comparing the content or value of objects.
Example: String str1 = new String("hello"); String str2 = new String("hello"); str1 == str2 will return false, but str1.equals(str2) will return true.
Java program to check if a number is prime
Create a function that takes an integer as input
Check if the number is less than 2, return false
Iterate from 2 to the square root of the number, check for divisibility
If the number is divisible by any number, return false
Otherwise, return true
A prime number is a number greater than 1 that can only be divided by 1 and itself.
Prime numbers are integers greater than 1
They have only two factors: 1 and the number itself
Examples of prime numbers: 2, 3, 5, 7, 11, 13
The final keyword in Java is used to restrict the user from changing the value of a variable, making a method not overrideable, or preventing a class from being subclassed.
Final variables cannot be reassigned once initialized
Final methods cannot be overridden in subclasses
Final classes cannot be subclassed
Final parameters in a method cannot be modified within the method
Top trending discussions
Some of the top questions asked at the Northcorp Software Java Developer interview -
based on 42 interview experiences
based on 45 reviews
Rating in categories
Devops Engineer
9
salaries
| ₹1.5 L/yr - ₹6.8 L/yr |
Software Developer
8
salaries
| ₹2 L/yr - ₹4.5 L/yr |
Senior Software Engineer
7
salaries
| ₹8.4 L/yr - ₹27 L/yr |
Senior Java Developer
6
salaries
| ₹14 L/yr - ₹22 L/yr |
Software Engineer
5
salaries
| ₹1 L/yr - ₹11.3 L/yr |
Zidio Development
Accel Frontline
Elentec Power India (EPI) Pvt. Ltd.
HyScaler