What is constructor and virtual function?

Answers were Sorted based on User's Feedback



What is constructor and virtual function?..

Answer / raj

constructor is special member function whose purpose to
initialize the class member variables.

Is This Answer Correct ?    10 Yes 0 No

What is constructor and virtual function?..

Answer / niranjanravi

Constructor is a special kind of method used to initialize
an object.

Is This Answer Correct ?    11 Yes 2 No

What is constructor and virtual function?..

Answer / lakshmi

Constructor is the function that has class name as its
function name with no return type and is used to initialize
the data members of the class.
virtual function is the function that can be overriden in
the derived class. it uses virtual keyword. it may or may
not be overloaded in derived class.
abstract function must be overridden in the derived class
inorder to create the instance.

Is This Answer Correct ?    4 Yes 0 No

What is constructor and virtual function?..

Answer / ravikiran(aptech mumbai)

constructor name is of the class name which has no return
type and is used o initialize during instantiation of class.

virtual function is the function called t runtime

Is This Answer Correct ?    3 Yes 2 No

What is constructor and virtual function?..

Answer / rohit saini

Contructor is the special type of method which is used
initialize the data member the class

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

Java support what type of parameter passing ?

7 Answers   Wipro,


write SQL command for table employee where print first name or last name start like "A" and who is working in domain(angular js,java,dotnet)

1 Answers  


What is map and hashmap? also tell the difference.

1 Answers  


How is a variable stored in memory?

0 Answers  


How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?

0 Answers  






What is immutable class in java?

0 Answers  


What is ascii code?

0 Answers  


Difference between a Canvas and a Scroll Pane?.

1 Answers   NIIT,


public class Test { public static void main(String[] args) { int countA = 0; int countB = 0; int countC = 0; int countD = 0; int countE = 0; int countF = 0; int countG = 0; int countH = 0; int countI = 0; int countJ = 0; int countK = 0; int countL = 0; int countM = 0; int countN = 0; int countO = 0; int countP = 0; int countQ = 0; int countR = 0; int countS = 0; int countT = 0; int countU = 0; int countV = 0; int countW = 0; int countX = 0; int countY = 0; int countZ = 0; } } Can anybody tell me any alternate solution(like loop or something) to automate this initialization process. Ex:- for(char chr='A';chr<='Z'; chr++) { (int) String "count"+chr = 0; }

0 Answers  


Can I import same package/class twice?

0 Answers  


What are void methods?

0 Answers  


Do you know how to reverse string in java?

0 Answers  


Categories