Add office photos
Engaged Employer

Northcorp Software

4.3
based on 332 Reviews
Video summary
Filter interviews by

40+ Altimetrik Interview Questions and Answers

Updated 24 Feb 2025
Popular Designations

Q1. An abstract class can have method implements and abstract method, while an interface only contains abstract method (before Java 8) . Abstract classes support single inheritance, whereas interfaces support multi...

read more
Ans.

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 support single inheritance, allowing for a hierarchical struc...read more

Add your answer

Q2. What is the difference between abstract class and an interface in Java?

Ans.

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 implement.

  • Example: Abstract class - Animal with abstract metho...read more

Add your answer

Q3. What is the D/W Hashmap and ConcurrentHashmap in Java?

Ans.

D/W Hashmap and ConcurrentHashmap are both implementations of the Map interface in Java, with the latter being thread-safe.

  • D/W Hashmap stands for 'Doubly-Linked Hashmap' and is a custom implementation of a hashmap in Java that maintains insertion order.

  • ConcurrentHashmap is a thread-safe implementation of the Map interface in Java, allowing multiple threads to access and modify it concurrently without causing data corruption.

Add your answer

Q4. What is the difference between HashMap and ConcurrentHashMap?

Ans.

HashMap is not thread-safe and allows null keys/values, while ConcurrentHashMap is thread-safe and does not allow null keys/values.

  • HashMap is not thread-safe and can lead to ConcurrentModificationException if modified while iterating.

  • ConcurrentHashMap uses internal locking mechanisms to provide thread-safety.

  • ConcurrentHashMap does not allow null keys/values, while HashMap does.

  • ConcurrentHashMap is more suitable for concurrent operations compared to HashMap.

Add your answer
Discover Altimetrik interview dos and don'ts from real experiences

Q5. What is the diffrence between == and .equals() in java?

Ans.

In Java, == compares memory addresses while .equals() compares the actual values of objects.

  • == compares memory addresses of objects

  • .equals() compares the actual values of objects

  • Use == for comparing primitive data types

  • Use .equals() for comparing objects like Strings

Add your answer

Q6. What is the difference between ==and .equals() in java?

Ans.

In Java, == compares memory addresses while .equals() compares the actual content of objects.

  • == compares memory addresses of objects, while .equals() compares the actual content of objects.

  • == is used to compare primitive data types, while .equals() is used to compare objects.

  • Example: String str1 = new String("hello"); String str2 = new String("hello"); str1 == str2 will be false, but str1.equals(str2) will be true.

Add your answer
Are these interview questions helpful?

Q7. == : Compares refrences (memory addresses) of objects. .equals() : Compares to content (value) of objects.

Ans.

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.

Add your answer

Q8. 1 : Declare the class as final. 2 : Make all fields private and final. 3 : Provide no setter methods.

Ans.

The question is asking to create a class with certain restrictions like being final, having private and final fields, and no setter methods.

  • Declare the class as final to prevent it from being subclassed.

  • Make all fields private and final to ensure encapsulation and immutability.

  • Provide no setter methods to enforce read-only access to the fields.

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. ==compares object references (memory location) .equals() compares the actual content or values of the objects.

Ans.

The question explains the difference between == and .equals() in Java for comparing object references and content.

  • Use == to compare object references (memory location)

  • Use .equals() to compare the actual content or values of the objects

  • Example: String str1 = new String("hello"); String str2 = new String("hello"); str1 == str2 will be false, but str1.equals(str2) will be true

Add your answer

Q10. What is the purpose of the volatile keyword?

Ans.

The volatile keyword in Java is used to indicate that a variable's value will be modified by different threads.

  • Ensures visibility of changes made by one thread to other threads

  • Prevents compiler optimizations that could reorder instructions

  • Useful for variables accessed by multiple threads without synchronization

  • Example: volatile boolean flag = true;

Add your answer

Q11. What is the purpose of the final keyword in Java?

Ans.

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

Add your answer

Q12. What is the purpose of static keyword in Java?

Ans.

The static keyword in Java is used to create class-level variables and methods that can be accessed without creating an instance of the class.

  • Static variables are shared among all instances of a class.

  • Static methods can be called without creating an instance of the class.

  • Static blocks are used to initialize static variables.

  • Static keyword can also be used to create static nested classes.

Add your answer

Q13. Can a java class extend multiple classes?

Ans.

No, a Java class cannot extend multiple classes.

  • Java does not support multiple inheritance for classes.

  • A class can only extend one other class, but can implement multiple interfaces.

  • Example: class MyClass extends ParentClass implements Interface1, Interface2

Add your answer

Q14. What is the default value of an int in Java?

Ans.

The default value of an int in Java is 0.

  • In Java, when an int variable is declared but not initialized, it is automatically assigned the default value of 0.

  • For example, int num; // num is assigned the default value of 0.

Add your answer

Q15. How can you create immutable class in Java?

Ans.

Immutable class in Java cannot be modified after creation, ensuring data integrity.

  • Make the class final so it cannot be extended

  • Make all fields private and final so they cannot be modified

  • Do not provide setter methods, only getter methods to access the fields

  • If the class contains mutable objects, make sure to return a deep copy of them in getter methods

Add your answer

Q16. What is the use of final Keyword in Java?

Ans.

The final keyword in Java is used to restrict the user from changing the value of a variable, making a method not overrideable, or making a class not inheritable.

  • Final variables cannot be reassigned once initialized.

  • Final methods cannot be overridden in subclasses.

  • Final classes cannot be extended by other classes.

Add your answer

Q17. Write a short java program to check if a number is prime.

Ans.

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

Add your answer

Q18. There are three types of programming language. 1 - Hgh Level. 2 - Mid Level. 3 - Low Level.

Ans.

High level languages are closer to human language, mid level languages are a mix of high and low level, and low level languages are closer to machine language.

  • High level languages are easier to read and write, like Java or Python.

  • Mid level languages provide a balance between high and low level, like C++.

  • Low level languages are closer to machine language, like Assembly.

Add your answer

Q19. The final keyword s used to declare: Final variables, Final methods and Final classes.

Ans.

The final keyword is used to declare final variables, final methods, and final classes in Java.

  • Final variables cannot be reassigned once initialized.

  • Final methods cannot be overridden in subclasses.

  • Final classes cannot be extended.

Add your answer

Q20. Defining multiple methods with the same name but different parameters.

Ans.

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.

Add your answer

Q21. HashMap is not thread-safe, while concurrentHashMap is thread-safe.

Ans.

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 concurrent modifications without the need for external sy...read more

Add your answer

Q22. What is the role of a java developer?

Ans.

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

Add your answer

Q23. How does JVM optimize method calls?

Ans.

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.

Add your answer

Q24. ==compares object refrences (memory location). -equals() compares object values.

Ans.

The difference between == and equals() in Java for comparing object references and values.

  • Use == to compare object references (memory location)

  • Use equals() to compare object values

  • Example: String str1 = new String("hello"); String str2 = new String("hello"); str1 == str2 will be false, but str1.equals(str2) will be true

Add your answer

Q25. How many types of programming languages?

Ans.

There are three main types of programming languages: high-level, low-level, and middle-level.

  • High-level languages are closer to human language and easier to understand, like Java, Python, and Ruby.

  • Low-level languages are closer to machine language and harder to understand, like Assembly and Machine Code.

  • Middle-level languages, like C and C++, combine elements of both high-level and low-level languages.

Add your answer

Q26. What is the size of an int in Java?

Ans.

The size of an int in Java is 4 bytes.

  • An int in Java is a 32-bit signed integer.

  • It can hold values ranging from -2,147,483,648 to 2,147,483,647.

  • The size of an int is fixed at 4 bytes on all platforms.

Add your answer

Q27. ==compares object references, while .equals() compares object values in java.

Ans.

In Java, == compares object references, while .equals() compares object values.

  • Use == to compare if two object references point to the same memory location.

  • Use .equals() to compare if two objects have the same values.

  • Example: String str1 = new String("hello"); String str2 = new String("hello"); str1 == str2 will be false, but str1.equals(str2) will be true.

Add your answer

Q28. The size of an int in Java is 4 bytes (32bits).

Ans.

Yes, the size of an int in Java is indeed 4 bytes (32 bits).

  • An int in Java can hold values ranging from -2,147,483,648 to 2,147,483,647.

  • The size of an int can be confirmed using the 'Integer.SIZE' constant in Java.

  • Using 'Integer.BYTES' will give the size of an int in bytes.

Add your answer

Q29. What is Java related framework?

Ans.

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, JavaServer Faces (JSF), and Apache Wicket.

Add your answer

Q30. What is JAVA Programming language?

Ans.

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 software

Add your answer

Q31. Develop, test and maintain java application.

Ans.

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

Add your answer

Q32. A prime number is a number greater than 1.....etc

Ans.

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

Add your answer

Q33. What is the stands for JAVA?

Ans.

Java stands for Just Another Virtual Machine

  • Java stands for Just Another Virtual Machine

  • It is a high-level programming language developed by Sun Microsystems

  • Java code is compiled into bytecode that runs on any Java Virtual Machine (JVM)

Add your answer

Q34. What is method overloading?

Ans.

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)

Add your answer

Q35. What is JAVA Full Form?

Ans.

JAVA stands for Java Virtual Machine

  • JAVA stands for Java Virtual Machine

  • It is a programming language that follows the principle of 'write once, run anywhere'

  • Java code is compiled into bytecode which can run on any platform with Java Virtual Machine (JVM)

  • Examples of Java applications include web applications, mobile apps, and enterprise software

Add your answer

Q36. What is inheritance in JAVA?

Ans.

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

Add your answer

Q37. What is the Java Language?

Ans.

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 known for its robust security features, such as sandboxing and encryption.

  • Java is object-oriented, allowing for the creation of reusable code through classes and objects.

Add your answer

Q38. What is Java Language?

Ans.

Java is a high-level, object-oriented programming language known for its portability and versatility.

  • 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 robust standard library, which includes tools for networking, data structures, and more

Add your answer

Q39. What is stands for JAVA?

Ans.

JAVA stands for Java Virtual Machine

  • JAVA stands for Java Virtual Machine

  • It is a virtual machine that enables a computer to run Java programs

  • It provides a platform-independent execution environment for Java applications

Add your answer

Q40. The default value of an int is 0.

Ans.

Yes, the default value of an int in Java is 0.

  • In Java, when an int variable is declared but not initialized, it will have a default value of 0.

  • For example, int num; will have a default value of 0.

  • This default value is assigned by the Java Virtual Machine (JVM) when memory is allocated for the variable.

Add your answer

Q41. What is JVM in JAVA?

Ans.

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 of JVM implementations include Oracle HotSpot, OpenJ9, and Gra...read more

Add your answer

Q42. What is the Java?

Ans.

Java is a high-level, object-oriented programming language known for its portability, security, and versatility.

  • 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 strong security features, such as sandboxing and encryption

  • Popular Java frameworks include Spring, Hibernate, and Apache Struts

Add your answer

Q43. What is Java API?

Ans.

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 more.

  • Examples of Java API components include java.lang, java.util,...read more

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Altimetrik

based on 36 interviews
1 Interview rounds
Technical Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Java Developer Interview Questions from Similar Companies

3.7
 • 193 Interview Questions
3.7
 • 86 Interview Questions
3.8
 • 32 Interview Questions
3.5
 • 19 Interview Questions
3.8
 • 13 Interview Questions
3.6
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter