Saturday, August 4, 2012

How many objects are created for a particular class how to find?

class One
{
static int count = 0;
One()
{
count++;
System.out.println("Number of Object created :"+count);
}
public static void main(String[] args)
{
new One();
new One();
new One();
new One();
One o = new One();
}
}

2 comments:

  1. You share informative information related to creating object and class in detail. This post is very helpful for students. Moreover, In order to avoid any issues, you should contact them before the move and discuss what your expectations are with regards to their services. The Piano Moving Services in Montreal QC provide the best work. They guarantee a professional service at a competitive price!

    ReplyDelete
  2. There is no limit for objects to Create a Java Script class.
    We Have professional Janitors who provide you the best customized Best Janitorial Services in Piscataway, NJ.

    ReplyDelete