can abstract class have constructor how can you achive
this ?
Answers were Sorted based on User's Feedback
Answer / rajasekharreddy.y
Yes abstract class must have the constructor, these
constructor we can achive by creating the instance of the
concreate subclass of the abstract class.
| Is This Answer Correct ? | 14 Yes | 2 No |
Answer / bhargava
You cannot crate the constructor for an abstract class
directly. But you can create constructor for subclass for
an abstract class by making new class sub class for the
abstract class.
| Is This Answer Correct ? | 1 Yes | 7 No |
Difference in the use of print, println, and printf.
What is annotation in java?
Does java trim remove newline?
What is proper subset?
How are java objects passed to a method and what are native methods?
Explain heap sort?
What is linkedlist in java?
I declared main() method as private. But it still running and displaying the output. Please Answer it . Code Snippet as Below: import java.io.*; class over { private static void main(String[] args) { int high = Integer.MAX_VALUE; int overflow = high + 1; int low = Integer.MIN_VALUE; int underflow = low - 1; System.out.println(high + "\n" +overflow +"\n"+ low +"\n"+underflow); //System.out.println(overflow); //System.out.println(low); //System.out.println(underflow); } }
What is void in java?
Java does not support multiple inheritance. how interface helps in the same?
how to convert Java project into Maven ?
What is exception handling in java?