Can a class have a constructor?



Can a class have a constructor?..

Answer / Himanshu Bhatnagar

Yes, a class can have a constructor to initialize its state when an object is created. If no constructor is explicitly defined, Java provides a default constructor with no arguments.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

Define the term “percolate down”?

1 Answers  


How to sort an Array?

1 Answers  


Which is faster quick sort or merge sort?

1 Answers  


In which matrix, we can use multilinked structures?

1 Answers  


Describe tree database.

1 Answers  


Write programs for Bubble Sort, Quick sort

15 Answers   Cognizant,


Design a datastructure to represent the movement of a knight on a chess board

1 Answers   Amazon,


Is duplicate allowed in hashmap?

1 Answers  


How to use appendNode() in linkedlist()?

1 Answers  


Is linkedlist thread safe?

1 Answers  


What do you mean by open addressing?

1 Answers  


What do you mean by rehashing?

1 Answers  


Categories