i
Northcorp
Software
Filter interviews by
Java API stands for Java Application Programming Interface, which provides a set of pre-written code for common tasks in Java programming.
Java API includes classes, interfaces, packages, and methods that developers can use to interact with the Java programming language.
It simplifies the development process by providing ready-to-use components for tasks like file handling, networking, database connectivity, and mor...
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)
Method overloading allows defining multiple methods with the same name but different parameters.
Methods must have different parameter types or number of parameters.
Return type does not matter for method overloading.
Example: void print(int num) and void print(String text) are valid overloads.
A Java developer is responsible for designing, developing, and maintaining Java-based applications.
Designing and implementing Java applications
Writing efficient and maintainable code
Testing and debugging code
Collaborating with team members to solve technical problems
Keeping up-to-date with Java technologies and best practices
D/W HashMap is a standard map, while ConcurrentHashMap is thread-safe for concurrent access in Java.
HashMap allows null keys and values, while ConcurrentHashMap does not allow null keys or values.
HashMap is not synchronized, making it unsuitable for concurrent use without external synchronization.
ConcurrentHashMap uses a lock striping technique, allowing concurrent read and write operations.
Example of HashMap: Has...
Java does not have a full form; it is a programming language developed by Sun Microsystems, now owned by Oracle Corporation.
Java was created in 1995 by James Gosling and his team at Sun Microsystems.
It is an object-oriented programming language, which means it uses objects to represent data.
Java is platform-independent due to its 'Write Once, Run Anywhere' (WORA) capability, enabled by the Java Virtual Machine (JV...
The volatile keyword in Java ensures visibility of changes to variables across threads.
1. Visibility: Changes made by one thread to a volatile variable are visible to other threads immediately.
2. No Caching: Volatile variables are not cached thread-locally, ensuring the latest value is always read.
3. Use Case: Commonly used in scenarios like flags or state indicators that are accessed by multiple threads.
4. Exampl...
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.
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...
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...
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 41 interview experiences
based on 44 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