Member-only story
Java Interview Questions And Answers (Part-2)
In this article, we will provide a comprehensive guide to Java Interview Questions, tailored for both freshers and experienced professionals.
Q26. Do you know mocking? and could you please explain a scenario where you have used mocking?
Ans :
It is process of creating substitutes for component classes to perform unit testing.
As part of our application we have many controller classes. In order to write junit scripts for controller we have used mocking.
we can also mock the third party APi call while writting junit test cases.
for our DB layer testing , we have created the mock object to get mock data and verify our code functionallity.
Q27. How you will debug issue in production environment ?
Ans :
Using log files I will identify where exactly the issue occurred.
Q28. What is Logging ?
Ans : Logging is just a fancy word to define a process of writing down everything you do.
There are several kinds of logging. You may log every operation of an application, log only when error occurs, or log critical operation done by a user, especially if you want to have control of who’s doing what for audit purposes.
Application can log at a code level for…