what is default constructor and parameterised constructor
with example?
Answer / tushar
Default constructor: this constructor is created by the compiler automatically whenever an object is created.User don't have to write default constructor every class has its default constructor
Parameterized constructor: this constructor is exclusively written by the coder to assign the initial value to an instance variable.By creating parameterized constructor you can overwrite the default constructor.
| Is This Answer Correct ? | 1 Yes | 0 No |
How to solve the problem of generating the unique hash keys with hash function?
Why does java have different data types for integers and floating-point values?
How to sort an array from smallest to largest java?
how we can write the string concatenation program in java.
How to check if a list is sorted in java?
In how many ways we can do exception handling in java?
Can we override static methods?
18 Answers Bally Technologies,
Write a function to find out longest palindrome in a given string?
class A{ some variables; public void a()throws Excepion1,Exception2{....} } class B extends A{ variables... public void a()throws E2,E3{.....} } Qns: here override of methods occurs or not,ore else wil give any compilation error or run properly..plz tell me briefly whts happening with the above codes....
What should I import for arraylist in java?
How is it possible in java programming for two string objects with identical values not to be equal under the == operator?
is it possible to instantiate the math class?