Aquilonis Interview Question: how to count the instances of... | Glassdoor.co.in

Interview Question

Intern Interview(Student Candidate) Indore

how to count the instances of a class?

Tags:
java
Answer

Interview Answer

3 Answers

0

none

Interview Candidate on 20-Jul-2012
0

simply buy counting the number of objct made up for tht class

kartik kothari on 04-Sep-2012
2

Take a static variable and increment it in a default constructor.
This value gives the number of instances created for that class

Vindhya on 29-Sep-2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.