Val the question is different.
Mindy
Yes you can declare classes in otherways also.
you can create new classes inside another class. these are called innner classes
And you can declare classes in
methods Yes methods also, these class are called local classes and the scope of these classes will be limited to that method, but they can access all the datamembers and method of the outer class.
Another way is to create a class without any name. These are called
Anonymous Classes.
It depends on exactly your application needs. if want to create a class for using only once, you can use anonymous classes.
you can create in whatever way you want, provided you follow the rules of road.
Your next question...
Can a constructor extends an object? Nope you can use the
word extends only for classes and interfaces.
You can create a new class (e.g JFrame ) in the constructor also.
Hope this helps
cheers
Siva