Interview Questions

Category Archives: Interview Questions

Does JVM create object of Main class ?

Does JVM create object of Main class ? It’s a common and important Interview Question in Java or Automation QA Interview. The answer of this is “NO“, JVM doesn’t create the Object of the Main Class.   Let’s consider the following program:-

Output: Hello   We have studied that the reason for main() static in … Continue reading Does JVM create object of Main class ?

Double Click Element using Selenium WebDriver

Let’s see, How can you double Click element using Selenium Webdriver. In this tutorial, we will explain how to work with Actions Class for double clicking an element by taking a simple example. We have already seen, we need to use Actions class in Selenium WebDriver to work on Mouse and Keyboard Actions.   The … Continue reading Double Click Element using Selenium WebDriver

How to Write XLS and XLSX File in Java – Apach POI Example

In this tutorial, You will see How can you write the XLS or XLSX files in Java using Apache POI. Java doesn’t provide direct API to read and write Excel document, you have to rely on third party libraries. In the last article, We have seen How to read .xls or .xlsx file in java. To … Continue reading How to Write XLS and XLSX File in Java – Apach POI Example

Find Smallest and Largest number in N numbers without using Array

This is most commonly asked question in Java Interview are, How do you find smallest and largest number in N numbers without using the Array in Java. Well, Can you write the program to solve this problem? It’s easy to solve this problem. To solve this issue, All you need to do is start with Integer.MIN_VALUE … Continue reading Find Smallest and Largest number in N numbers without using Array

Difference Between Java and JavaScript

Let’s see, What is the difference between Java and JavaScript. Many of us think that JavaScript is part of Java platform, which is not true. In truth, JavaScript has nothing to do with Java, the only common thing between them is word “Java” Java is high-level Programing language and JavaScript is a scripting language.   … Continue reading Difference Between Java and JavaScript

What is Difference between Loop and Enhanced Loop in Java

We have used both loop and enhanced loop to iterate over arrays and collections like a list, set, or map. There are many differences between them like- enhanced for loop is much more easy to use than for loop. In for loop you need to manage the steps manually. But at the same time, for … Continue reading What is Difference between Loop and Enhanced Loop in Java

How to Increment and Decrement Date in JAVA

Let’s see, How can you increment and decrement Date in Java. In Java, we need to perform operations on Date like Add date in current date or Subtract date from Current Date. Sometimes we need to get the tomorrow date or yesterday date.   In Java, you can achieve the Date operation using two ways. … Continue reading How to Increment and Decrement Date in JAVA

Can We Override Static Method in Java

One of the common Java interview questions is, Can We Override Static Method in Java? The Answer is NO, We can’t Override the static function in Java. But we can Overload the Static Method in Java. Now the new question Now the new question raised by interviewer Why? Why you can’t override but overload the Static method. … Continue reading Can We Override Static Method in Java