Apmosys Technologies
Konark Polytubes Interview Questions and Answers
Q1. What is the difference between string buffer and string builder?
String buffer is synchronized and thread-safe, while string builder is not synchronized and faster.
String buffer is synchronized, making it thread-safe for use in multi-threaded environments.
String builder is not synchronized, providing better performance in single-threaded applications.
String builder is faster than string buffer due to lack of synchronization overhead.
Example: StringBuffer sb = new StringBuffer(); StringBuilder sb = new StringBuilder();
Q2. What are the different types of exception in java?
There are two types of exceptions in Java: checked exceptions and unchecked exceptions.
Checked exceptions are checked at compile time and must be handled using try-catch or throws keyword.
Unchecked exceptions are not checked at compile time and include RuntimeException and its subclasses.
Examples of checked exceptions include IOException, SQLException, and ClassNotFoundException.
Examples of unchecked exceptions include NullPointerException, ArrayIndexOutOfBoundsException, and...read more
Q3. What are the 4 principles of oops?
The 4 principles of OOP are Inheritance, Encapsulation, Abstraction, and Polymorphism.
Inheritance allows a class to inherit properties and behavior from another class.
Encapsulation restricts access to certain components within a class, protecting the data.
Abstraction hides complex implementation details and only shows the necessary features.
Polymorphism allows objects to be treated as instances of their parent class.
Q4. Why strings are immutable?
Strings are immutable in order to ensure data integrity and security.
Immutable strings prevent accidental data modification, ensuring data integrity.
Immutable strings enhance security by preventing unauthorized access or tampering.
Immutable strings allow for more efficient memory management and optimization.
Example: 'Hello' cannot be changed to 'Hella' directly, a new string must be created.
Q5. Difference between JDK jvm and jre
JDK includes JRE and development tools, while JRE includes only the Java Runtime Environment.
JDK stands for Java Development Kit, which includes JRE and development tools like compilers and debuggers.
JRE stands for Java Runtime Environment, which includes JVM and libraries necessary to run Java applications.
JVM stands for Java Virtual Machine, which is responsible for executing Java bytecode.
JDK is used for developing Java applications, while JRE is used for running Java appl...read more
Q6. Explain linear search algorithm.
Linear search is a simple searching algorithm that sequentially checks each element in a list until a match is found.
Iterate through each element in the list
Compare the current element with the target value
Return the index if a match is found, otherwise return -1
Q7. Operator overloading in Java?
Operator overloading allows operators to be redefined for user-defined types in Java.
Operator overloading is not supported in Java as it can lead to ambiguity and confusion.
Java does not allow custom operators to be defined or existing operators to be overloaded.
Instead of operator overloading, Java provides method overloading where methods with the same name but different parameters can be defined.
Q8. Define java and it's features
Java is a high-level, object-oriented programming language known for its platform independence and robust 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 robust standard library, which includes tools for networking, I/O, and more
It supports multithreading, allowing for concurrent execution of code
Java is statically typed, providing type s...read more
Interview Process at Konark Polytubes
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month