A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Certification
»
Programmer Certification (SCJP/OCPJP)
Author
Abstract class and private constructor
Sri Rajasekhar Jonnalagadda
Greenhorn
Joined: Nov 04, 2003
Posts: 2
posted
Jan 14, 2004 23:44:00
0
Consider the following code
abstract class A {
private A() {}
}
How can a class which is supposed to be extended
have a constructor which is private.
dennis zined
Ranch Hand
Joined: Mar 07, 2003
Posts: 330
posted
Jan 15, 2004 00:09:00
0
This will only work if the abstract class is nested.
SCJP 1.4<br />SCWCD 1.4
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: Abstract class and private constructor
Similar Threads
class Math is concrete class but still it cannot be instantiated.
abstract class
final and abstract
Constructor in abstract class
Can constructors be declared private:If so whar are the advatages
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter