Originally posted by Krithika Srinath: You cannot have a variable declared as abstract in java. What is your requirement? Why do you need abstract variable? Can you provide more details?
Think of it this way. Java defines only abstract classes and methods (as far as I've read so far). Abstract implies that the abstract methods within abstract classes must be coded. A variable cannot be coded because it is a primitive or reference that can only be assigned a value.
You cannot do something like this:
It is like trying to fit a square peg in a round hole, or using kitchen utinsels for farming .
Hope this example helps... Aloha, Doug
posted 11 years ago
Hello Krithika! I have read about abstract variable somewhere in Kathy-Book. I was just wondering about this. Now, there is no confusion. You are right. Thanks.