Can you have a constructor in abstract class?

Answer Posted / saurabh

public class xyz : abc
{
int r = 10;

public xyz()
{
r = 35;


}


}
public abstract class abc
{
public int i = 0;
public abc()
{
i = 10;
}
}

sure , we can create constructor in abstract class.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between hashmap and hashtable in java?

749


What is meant by main method?

764


What's the purpose of using break in each case of switch statement?

712


how does the run() method in runnable work? : Java thread

676


Where is java located?

707


How many types of assembly languages are there?

710


How to provide security in java

1986


when a request is generated from apache tomcat 5.5 and goes to oracle 10g or mysql,,, how the oracle or mysql reads the request as apache is a web server and oracle 10g is application server? when the oracle 10g provides response, how the apche tomcat reads it???

1877


What is the difference between serial and throughput garbage collector?

757


What is array sorting in java?

749


What is use of super keyword in java?

780


What is pangram in java?

738


How do you use parseint in java?

691


What are predicates in java 8?

763


What are the methods used to implement for the key object in the hash map?

768