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 are locale settings?

539


What is string example?

588


Can you explain the usages of class.forname()?

597


What is difference between printf and scanf?

510


What are the Class Libraries ?

587






Difference between current previous versions of Java?

549


What do you mean by thread safe?

529


Should database connections be singleton?

560


What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?

586


What’s the difference between applets and standalone program?

522


Can we create a class inside a class in java?

537


Why does java not support pointers?

543


Why do people says “java is robust”?

544


What are different ways of object creation in java ?

564


Why method overriding is used?

531