Answer Posted / bindhu
Constructor is special type of member function that will
automatically invoke when an object creates. The purpose of
constructor is for the initialization of instance
variables. A constructor having the same name as that of
class name. It may have arguments but doesn't return
anything.
If we want to initialize all objects of the same class
with same values, use default constructor.Otherwise, we can
use parameterized constructor if we want to initialize
objects of the same class with different values. If we
don't specify any constructor , compiler will use default
constructor with garbage value.
| Is This Answer Correct ? | 35 Yes | 4 No |
Post New Answer View All Answers
What do you mean by append?
Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example
Is node a data type in java?
How do you get the length of a string in java?
Write code to implement bubble sort in java?
How do I write a self declaration?
worst case complexities of Quick sort and Merge sort.
What do you mean by mnemonics?
Which method returns the length of a string?
What is an exception? difference between Checked and Unchecked exception in Java
Explain the difference between treeset and treemap in java?
Explain the available thread states in a high-level?
Which data type is a class in java?
Does every java program need a main?
What is treeset in java?