SUBSCRIBE HERE TO GET POST UPDATES VIA EMAIL :

Delivered by FeedBurner

Java Interview Questions For Selenium WebDriver - Part 1

PART 1

1 : What is object in java?

Answer : Object Is an Instance of class and it has its own state and behavior. In real world we can say, Dog is object of Animal class which have different state like breed, color, name, hungry, etc and behavior  like wagging tail, fetching, barking etc.

2 : What is class?

Answer : A class is the blueprint or we can say template from which individual objects are created.

3 : What is constructor?

Answer : Constructor is a code block just like a method which is used to initialize the state of an object. It will be invoked at the time of object creation to construct the value for object. VIEW DETAIL

4 : What is default constructor?

Answer : If there is not any constructor in class then java compiler creates default constructor. It is no argument constructor which initializes any uninitialized fields to their default values.

5 : Constructor returns any value?

Answer : Yes. It will return instance of current class (However we can not use return type with constructor).

2 comments:

  1. Great stuff...Thanks for the valuable links.

    ReplyDelete
  2. can u please update other topics like frameworks,pom,apache poi,all other topics .it helpful for all who is searching for jobs in selenium

    ReplyDelete