Add office photos
Engaged Employer

Northcorp Software

4.4
based on 379 Reviews
Filter interviews by

30+ NISA Global Interview Questions and Answers

Updated 22 Jan 2025
Popular Designations

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

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

Q3. == : 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

Q4. 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
Discover NISA Global interview dos and don'ts from real experiences

Q5. ==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

Q6. 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
Are these interview questions helpful?

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

Q8. 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
Share interview questions and help millions of jobseekers 🌟

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

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

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

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

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

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

Q15. ==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

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

Q17. ==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

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

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

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

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

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

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

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

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

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

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

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

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

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

Q31. 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
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at NISA Global

based on 26 interviews in the last 1 year
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
 • 164 Interview Questions
3.7
 • 39 Interview Questions
3.9
 • 35 Interview Questions
3.6
 • 12 Interview Questions
3.8
 • 11 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
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

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