What is constructor and virtual function?
Answers were Sorted based on User's Feedback
Answer / raj
constructor is special member function whose purpose to
initialize the class member variables.
Is This Answer Correct ? | 10 Yes | 0 No |
Constructor is a special kind of method used to initialize
an object.
Is This Answer Correct ? | 11 Yes | 2 No |
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 |
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 |
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 |
Java support what type of parameter passing ?
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)
What is map and hashmap? also tell the difference.
How is a variable stored in memory?
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?
What is immutable class in java?
What is ascii code?
Difference between a Canvas and a Scroll Pane?.
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; }
Can I import same package/class twice?
What are void methods?
Do you know how to reverse string in java?