Add office photos
Engaged Employer

Astrea IT Services

4.8
based on 36 Reviews
Filter interviews by

POSCO MAHARASHTRA STEEL Interview Questions and Answers

Updated 5 Feb 2024

Q1. What is a static keyword in java? Where are the static variables stored? One programmatic situation was given based on static keyword and i was asked the final output.

Ans.

The static keyword in Java is used to create variables and methods that belong to the class rather than instances of the class.

  • Static variables are stored in the static memory area, also known as the method area or permanent generation.

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

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

  • Static variables and methods can be accessed using the class name followed by the dot operator.

  • A programmatic situ...read more

Add your answer

Q2. What is Polymorphism? Difference between Runtime and static Polymorphism with the help of a program.

Ans.

Polymorphism is the ability of an object to take on many forms. Runtime polymorphism is achieved through method overriding.

  • Polymorphism allows objects of different classes to be treated as objects of a common superclass.

  • Static polymorphism is achieved through method overloading.

  • Runtime polymorphism is determined at runtime based on the actual type of the object.

  • Static polymorphism is determined at compile-time based on the number and types of arguments passed to a method.

  • Exam...read more

Add your answer

Q3. Why is String immutable ? difference between StringBuffer,String Builder and String with example ?

Ans.

String is immutable because it ensures data integrity and thread safety. StringBuffer and StringBuilder are mutable alternatives.

  • String is immutable, meaning its value cannot be changed once created.

  • Immutable strings ensure data integrity and thread safety.

  • StringBuffer and StringBuilder are mutable alternatives to String.

  • StringBuffer is synchronized and thread-safe, but slower.

  • StringBuilder is not synchronized, faster, but not thread-safe.

  • Example: String name = "John"; name +...read more

Add your answer

Q4. what is multiple inheritance and what is multilevel inheritance?

Ans.

Multiple inheritance is when a class inherits from more than one base class. Multilevel inheritance is when a class inherits from another derived class.

  • Multiple inheritance allows a class to inherit attributes and behaviors from multiple parent classes.

  • Multilevel inheritance involves a chain of inheritance where a derived class inherits from another derived class.

  • In multiple inheritance, conflicts may arise if two base classes have methods with the same name.

  • In multilevel inh...read more

Add your answer
Discover POSCO MAHARASHTRA STEEL interview dos and don'ts from real experiences

Q5. What is abstract keyword? what is abstract function?

Ans.

The abstract keyword is used in object-oriented programming to declare a class or method as abstract.

  • An abstract class cannot be instantiated and can only be used as a base for other classes.

  • An abstract method is a method without a body, and it must be implemented by any concrete subclass.

  • Abstract classes can have both abstract and non-abstract methods.

  • Abstract methods are used to define a common interface that all subclasses must implement.

  • The abstract keyword allows for the...read more

Add your answer

Q6. What are the main OOPs concepts?

Ans.

The main OOPs concepts are encapsulation, inheritance, and polymorphism.

  • Encapsulation: bundling of data and methods into a single unit (class) to hide implementation details.

  • Inheritance: ability of a class to inherit properties and methods from another class.

  • Polymorphism: ability of objects of different classes to be treated as objects of a common superclass.

View 1 answer

Q7. How does java implement multiple inheritance?

Ans.

Java implements multiple inheritance through interfaces.

  • Java does not support multiple inheritance of classes.

  • Instead, it allows multiple inheritance of interfaces.

  • A class can implement multiple interfaces, inheriting their methods and constants.

  • Interfaces provide a way to achieve multiple inheritance without the complexities of class inheritance.

  • Example: class A implements Interface1, Interface2 { ... }

Add your answer

Q8. Print prime numbers between 1 to n(optimized solution)

Ans.

The optimized solution to print prime numbers between 1 to n.

  • Start with a loop from 2 to n

  • For each number, check if it is divisible by any number from 2 to its square root

  • If it is not divisible by any number, it is a prime number and can be printed

Add your answer

Q9. What is an interface? is it abstract?

Ans.

An interface is a contract that defines a set of methods that a class must implement. It is not abstract.

  • An interface provides a way to achieve multiple inheritance in Java.

  • It allows for loose coupling between classes.

  • Interfaces can have constants and default methods.

  • A class can implement multiple interfaces.

  • Interfaces are used to achieve abstraction and provide a common behavior for classes.

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Top Astrea IT Services Interview Questions And Answers
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