Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers for 'Quinnox' - 3 question(s) found - Order By Newest | ||||
| ||||
Ans. Constructors are used for initializing the object state once it is initialized and memory has been reserved for it. Destructor is used to de-allocate memory allocated by objects. There are no destructors in Java. Alternatively, Java provides Automatic garbage collection i.e automatically releasing the un-referenced memory. | ||||
Sample Code for constructor | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  constructors  destructors Asked in 2 Companies | ||||
Try 1 Question(s) Test | ||||
Related Questions | ||||
Why every object constructor automatically call super() in Object before its own constructors? | ||||
Can constructors be synchronized in Java ? | ||||
Are constructors inherited? Can a subclass call the parent's class constructor? When? | ||||
Which of the following is false about Constructors ? | ||||
Which of the following cannot be marked static ? | ||||
Can we overload constructors ? | ||||
Is it advisable to set the member variables through constructors instead of setting them through setters ? | ||||
Why doesn't Java even allow void return types for Constructors ? | ||||
What is the use of constructors in Java ? | ||||
Frequently asked in face to face interviews. | ||||
| ||||
Ans. int count = 15; int[] fibonacci = new int[count]; fibonacci[0] = 0; fibonacci[1] = 1; for(int x=2; x < count; x++){ fibonacci[x] = fibonacci[x-1] + fibonacci[x-2]; } for(int x=0; x< count; x++){ System.out.print(fibonacci[x] + " "); } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  ebay   fibonacci series Asked in 66 Companies basic   frequent | ||||
Related Questions | ||||
What are the steps to be performed while coding Junit with Mocking framework ? | ||||
What is a Sequence File? | ||||
What different level of logging you use while coding ? | ||||
Have you ever encoded the response before sending it back from the service? If Yes , Which encoding was used ? | ||||
What are the different type of encoding you have used ? | ||||
How does encoding affect using Reader / writer classes or Stream classes in Java ? | ||||
What is the difference between html encoding and url encoding ? | ||||
Does spaces get's encoded in html encoding ? | ||||
| ||||
Ans. Destructor is used to de-allocate memory allocated by objects. There are no destructors in Java. Alternatively, Java provides Automatic garbage collection i.e automatically releasing the un-referenced memory. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  destructor  garbage collection Asked in 11 Companies Basic   frequent | ||||
Try 1 Question(s) Test | ||||
Related Questions | ||||
What are constructors and Destructors in Java ? | ||||
Why don't Java objects have destructors ? | ||||
In Java, would you like to see an explicit destructor? | ||||