Premium Employer

HCLTech

3.5
based on 36.3k Reviews
Filter interviews by

10+ Kohinoor Steel & Power Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. 1. How to connect 2 DBs from spring boot application

Ans.

To connect 2 DBs from a Spring Boot application, configure multiple data sources and use JdbcTemplate or EntityManager for each DB.

  • Configure multiple data sources in the application.properties file

  • Create separate configuration classes for each data source

  • Use JdbcTemplate or EntityManager to interact with each DB

  • Specify the appropriate data source in the repository or service classes

Add your answer

Q2. What is System.out.println?

Ans.

System.out.println is a Java statement used to print output to the console.

  • System is a class in Java's core library.

  • out is a static member of the System class.

  • println is a method of the PrintStream class.

  • It is used to print output to the console.

  • It adds a newline character at the end of the output.

View 5 more answers

Q3. What is difference between sleep or wait method?

Ans.

Sleep method pauses the thread for a specified time, while wait method pauses the thread until notified.

  • Sleep method is a static method of Thread class, while wait method is an instance method of Object class.

  • Sleep method does not release the lock on the object, while wait method releases the lock and waits for notification.

  • Sleep method can be interrupted by another thread, while wait method can only be interrupted by a call to notify or notifyAll method.

  • Example: Thread.sleep...read more

View 1 answer

Q4. 1)Compare two string using Java 8 features without comparator and comparable 2) Given an array to print non duplicate in the array 3) Solid principles 4) Stereo type annotations 5) how to make list immutable 6)...

read more
Ans.

The interview questions cover a range of topics related to Java development, including Java 8 features, data structures, annotations, and database triggers.

  • Use Java 8 features like streams and lambda expressions to compare two strings without using comparator or comparable.

  • To print non-duplicate elements in an array, use a HashSet to store unique elements and then iterate through the array to check for duplicates.

  • Solid principles refer to a set of design principles for object...read more

Add your answer
Discover Kohinoor Steel & Power interview dos and don'ts from real experiences

Q5. 2. Difference between abstract method implementation and default method

Ans.

Abstract method implementation is mandatory while default method is optional.

  • Abstract method has no implementation in the abstract class and must be implemented by the subclass.

  • Default method has a default implementation in the interface and can be overridden by the implementing class.

  • Abstract method is used to enforce a contract while default method is used to provide a default behavior.

  • Example: abstract method - public abstract void draw(); default method - default void dis...read more

View 1 answer

Q6. What is static or final method?

Ans.

Static or final method is a method that belongs to a class rather than an instance of the class.

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

  • Final method cannot be overridden by a subclass.

  • Static and final methods can be accessed using the class name.

  • Example: Math.max() is a static method in the Math class.

  • Example: String.toUpperCase() is a final method in the String class.

View 1 answer
Are these interview questions helpful?

Q7. What are the applications of java?

Ans.

Java is used for developing desktop, web, mobile, and enterprise applications.

  • Desktop applications like media players, IDEs, and scientific applications

  • Web applications like e-commerce websites, social media platforms, and banking portals

  • Mobile applications for Android devices

  • Enterprise applications like customer relationship management systems and supply chain management systems

View 1 answer

Q8. Add string or integer value using map?

Ans.

Yes, we can add string or integer value using map in Java.

  • We can use put() method to add values to a map.

  • For string values, we can use String as the value type.

  • For integer values, we can use Integer as the value type.

  • Example: Map map = new HashMap<>(); map.put("key", "value");

  • Example: Map map = new HashMap<>(); map.put("key", 123);

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

Q9. Different types of oops concepts in java?

Ans.

There are four main OOPs concepts in Java: Abstraction, Encapsulation, Inheritance, and Polymorphism.

  • Abstraction: Hiding implementation details and showing only necessary information.

  • Encapsulation: Wrapping data and methods into a single unit and restricting access to them.

  • Inheritance: Acquiring properties and behavior of a parent class by a child class.

  • Polymorphism: Ability of an object to take many forms and perform different actions based on the context.

Add your answer

Q10. What is collection?

Ans.

A collection is a group of objects that can be stored, manipulated, and retrieved as a single unit.

  • Collections are used to store and manage groups of related objects.

  • Java provides several built-in collection classes such as ArrayList, LinkedList, HashSet, etc.

  • Collections can be used to perform operations like sorting, searching, filtering, and more.

  • Collections can be generic or non-generic, depending on the type of objects they store.

Add your answer

Q11. What is oops concept?

Ans.

OOPs is a programming paradigm based on the concept of objects.

  • OOPs stands for Object-Oriented Programming.

  • It focuses on creating objects that contain both data and functions.

  • Encapsulation, Inheritance, Polymorphism, and Abstraction are the four main pillars of OOPs.

  • Java is an OOPs language.

  • Example: A car is an object that has properties like color, model, and functions like start, stop, and accelerate.

View 1 answer

Q12. Abstraction vs interface?

Ans.

Abstraction is a concept of hiding implementation details while interface is a contract that defines the behavior of a class.

  • Abstraction is achieved through abstract classes and methods

  • Interface is a collection of abstract methods and constants

  • Abstraction allows for flexibility in implementation

  • Interface allows for multiple inheritance

  • Abstraction is used for code reusability

  • Interface is used for achieving polymorphism

View 2 more answers

Q13. Overloading vs overriding?

Ans.

Overloading is when multiple methods have the same name but different parameters. Overriding is when a subclass provides a different implementation of a method inherited from its superclass.

  • Overloading is resolved at compile-time based on the method signature.

  • Overriding is resolved at runtime based on the actual object type.

  • Overloading is used to provide different ways to call a method with different parameters.

  • Overriding is used to provide a specific implementation of a meth...read more

View 1 answer

Q14. What is join in sql?

Ans.

Join in SQL is used to combine rows from two or more tables based on a related column between them.

  • Join is used to retrieve data from multiple tables in a single query

  • Types of join include inner join, left join, right join, and full outer join

  • Join condition is specified using ON keyword

  • Example: SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2.column

  • Join can also be used with subqueries

Add your answer

Q15. What is polymorphism?

Ans.

Polymorphism is the ability of an object to take on many forms.

  • Polymorphism allows objects of different classes to be treated as if they are of the same class.

  • It is achieved through method overriding and method overloading.

  • Example: A parent class Animal can have child classes like Dog, Cat, and Bird. All these child classes can have their own implementation of the method 'makeSound', which is overridden from the parent class.

  • Polymorphism helps in achieving code reusability an...read more

View 1 answer

Q16. What is inheritence?

Ans.

Inheritance is a mechanism in which one class acquires the properties and behaviors of another class.

  • It allows code reusability and saves time

  • The class that is inherited is called the superclass or parent class

  • The class that inherits from the superclass is called the subclass or child class

  • The subclass can access all the public and protected methods and fields of the superclass

  • Example: A Car class can inherit properties and behaviors from a Vehicle class

View 1 answer

Q17. What is java?

Ans.

Java is a high-level, object-oriented programming language used to develop applications for various platforms.

  • Java is platform-independent and can run on any device with a Java Virtual Machine (JVM)

  • It is known for its security features and is commonly used for developing web and mobile applications

  • Java is also used for developing enterprise-level applications and software tools

  • Examples of Java-based applications include Android apps, Minecraft, and Apache Hadoop

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

Interview Process at Kohinoor Steel & Power

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

Top Java Developer Interview Questions from Similar Companies

3.6
 • 164 Interview Questions
3.8
 • 35 Interview Questions
3.8
 • 32 Interview Questions
4.0
 • 16 Interview Questions
4.5
 • 11 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