Sir your video is very useful to those person who will really want to learn java but they can understand java concept in colleges or tuition... and this Vedic is also useful to me for learn java in detail ... thank u so much sir for providing this Vedic for us.
Hello, sir aap java main logic k programs videos banaye ap ka explination bahoti achha hai jo app explain kartein hai wo sab yaad reh jata hai or samj main bhi aa jate hai, job liye interview main mostly puchhe jane wala programs videos laye sir and thanks for teaching us. 😊
thks sir good speaking in hindi as well as understanding of code ,i like that type of study becouse im not understanding by Choching Center or tuition....so u r very helpfully teaching world
Thanks sir for ur classes And if uf pass argument in main class object like B obj = new B (1); Then the constructor without argument will not execute.. Out will be A 1 B 2 (B 1 will not execute)
Thank you sir! but i have a question sir. Sir what if super class have many constructors of different arguments(constructor overloading) then how will we call all of them by subclass object....?
I think we can't call all the constructors of super class from subclass coz we can only use 1 super() or this(). But you can call all the super class constructors before subclass constructors by the help of this().
Hi sir, can u plz provide me the link of the slides that u r showing in your videos so that i dont need to writedown everything i can just refer to those slides everytime i need to revise any topic..
Sir what would happen if we use this function in both the constructor of same Class I have not tried in on pc But out of curiosity I just want to know what would happen then?
this(); represents constructor of same class. with use of this(); we can call second constructor of the same class from first constructor. If this() is used super() is not called. This is called constructor chaining.
Sir agar ham chahty hain k inheritance ma sub class k constructor ko call karny sy super class ka constructor call na ho or na hi constructor chaining ho. Laikin super class ma constructor mojod ho to ya kasy kary gy
Heyy sir and all guys I have a query that sir told us that super keyword is default and it comes by itself at the first line so if we write this() than why super is not defaultly come in the first line ??
Sir if there is only one constructor in child class B, i. e. public B ( ). And we call this( ) in child class constructor B( ). Then will it become recursion? Also, in this case parent constructor will not be called..
Sir wo compile time error tohh dega lekin aapne video(10.00) me mention kia hai ki first line is either this() or super() and defaulty it will be super() that means it can never be this()..M I right?
nhi bhai... its not possible because inherited instance variables ka initialization parent k constructor me hi hota he isliye parent ka constructor chalana zaruri ho jaata he
Muhammad Adnan Akmal buddy if you want to prefrom a task in sequence as soon as your program run so for it you can use constructor chaining its mainly used in database connectivity
class A { int a; public A() { System.out.println("default class A"); } public A(int b) { a=b; System.out.println("class A"); } } class B extends A { int b; public B() { //*sir yaha par copiler super() nahi banata kyu?*// super(5); System.out.println("class B"); } } class ContructorInheritance { public static void main(String[] args) { B obj; obj = new B(); } }
because you have called for super(4) in the first line of the public B(){ super (4); }. so, the control goes to public A(int b), instead of public A(). if you had called just super () , the control would have gone to only public A(). hope i have explained simply :-)
rupam sinha roy . Thanks for reply but actually I m learning now DBMS ... And I forgot some concepts in java . 😂. I have to revision about it .. after revision I will read ur reply
Sir your video is very useful to those person who will really want to learn java but they can understand java concept in colleges or tuition... and this video is also useful to me for learn java in detail ... thank u so much sir for providing this Video for us.
easy to understand with practical, nice sir, keep it up 👍👍
U r also programmer now
Knock knock
Just like Indian Team Found Ms Dhoni..
bahut shi bro
Actually You know how to teach sir. You are far better than IITians PROFESSOR.
r u iitian?
Show off
laudu lalit xD
you are best teacher as so far I saw videos in youtube .... but the way you brief thats simply aesthetic
No words to say sir You are great Your explanation is amazing like you have wrote a java
Sir
Aj pehli video aisi dekhi jis pr ak b dislike nahi hy
Your Are Great, Love u sir seriouly :*
Sir your video is very useful to those person who will really want to learn java but they can understand java concept in colleges or tuition... and this Vedic is also useful to me for learn java in detail ... thank u so much sir for providing this Vedic for us.
Thank you so much sir for the excellent explanation!
sir kya mast explain kiya aapne bilkul easy way me samjh aa gya ❤
Hello, sir aap java main logic k programs videos banaye ap ka explination bahoti achha hai jo app explain kartein hai wo sab yaad reh jata hai or samj main bhi aa jate hai, job liye interview main mostly puchhe jane wala programs videos laye sir and thanks for teaching us. 😊
thks sir good speaking in hindi as well as understanding of code ,i like that type of study becouse im not understanding by Choching Center or tuition....so u r very helpfully teaching world
thanks sir (y)
your student from Pakistan
Thanks Sir you lectures are very Effective and also share these lectures to my friends.
Thanks sir for ur classes And if uf pass argument in main class object like
B obj = new B (1);
Then the constructor without argument will not execute..
Out will be
A 1
B 2
(B 1 will not execute)
brilliant sir...all the concepts are cleared...
vai wah . kya samjhaya hai. very good.
It is such an excellent explanation. Thank you so much for this video:)
Sir you are doing a great job!
keep it up 😊
Love you, great explanation
Very much informative lectures
Nice explanation 🙏🏻 thanks
thanku sir for fantastic explanation and my concept of this.
Thank you sir,great explanation
Thank you very much.
it was very helpful sir...ty :-)
Sir phir' this ' keyword ka use Kyu huva
Kyu ki program ne call tho phir bhi A1 hi kia
Sir, The Explanation is super();
But Sir, I have a question that Can we have Constructor Chaining through User give input??
sir, what is the difference between constructor with public access specifier and default access specifier?
"public A()" and only "A()"
Thank you sir! but i have a question sir.
Sir what if super class have many constructors of different arguments(constructor overloading) then how will we call all of them by subclass object....?
I think we can't call all the constructors of super class from subclass coz we can only use 1 super() or this().
But you can call all the super class constructors before subclass constructors by the help of this().
Bro if we go on superclass than first of all , all constructors of superclass will run than come to subclass
How can argument be passed in ctr being called by other ctr of same class? (ctr chaining case)
Hi sir,
can u plz provide me the link of the slides that u r showing in your videos so that i dont need to writedown everything i can just refer to those slides everytime i need to revise any topic..
bro try to make your own notes
nice explaination
Sir, can you please Show how to call any method from the body of another method..
This oppr likha he agar ham statment ke niche likhe ge tab to pahle b1 chale ga na?
Thanx Sir
sir please upload videos on J2EE
Sir what would happen if we use this function in both the constructor of same Class
I have not tried in on pc
But out of curiosity I just want to know what would happen then?
this error will come :- recursive constructor invocation
this is not possible bcz the rule for constrctor chaining is that their should be atleat one constructor without this() keyword...
sir plz add the videos of java swing
+priya chaudhary soon
sir hv u black red tree videos with algorithms....????
this(); represents constructor of same class.
with use of this(); we can call second constructor of the same class from first constructor.
If this() is used super() is not called.
This is called constructor chaining.
Hi sir,
Why can't we write both super and this in a constructor?
great
best sir g
Sir agar ham chahty hain k inheritance ma sub class k constructor ko call karny sy super class ka constructor call na ho or na hi constructor chaining ho. Laikin super class ma constructor mojod ho to ya kasy kary gy
Sir,
There is no lecture for the topic polymorphism.
Sir overloading k doran super constructor na chaly us k liy hta dy
@2:38 sir yaha toh variable hai hi nahi toh constructor kyu bana rahe hai?...sir aisa kya kar sakte hai ya fir aap variable banana bhul gaye
Heyy sir and all guys
I have a query that sir told us that super keyword is default and it comes by itself at the first line so if we write this() than why super is not defaultly come in the first line ??
it's for constructor bro
❤
love u sir. from Pakistan
waah sir itne popular ho gaye
Wah o
Parthosarothi
Sir, super aur this dono likh nhi skte per kam to ho rha hai tbhi to tino output me aaya???
ek hi constructor me dono nhi likh sakte...yaha different constructors me likha he
" this(i) " isme " i " zaroori hai kya.. Agar hai to kaise.???
sir this video is having noise disturbance
Huge change in Previous video to this video
sir aap ny gui ki examples nhi dein
Sir if there is only one constructor in child class B, i. e. public B ( ). And we call this( ) in child class constructor B( ). Then will it become recursion? Also, in this case parent constructor will not be called..
@Deepa Nair It will be a compile time error...
Sir wo compile time error tohh dega lekin aapne video(10.00) me mention kia hai ki first line is either this() or super() and defaulty it will be super() that means it can never be this()..M I right?
Sir hum super or this dono q nahi used nahi Kr sakte
What about parent class contrustctor is with parameter tham
use super("parameters")
Sir,
Compile karne par super automatic aa jata hai....
But this kyun nahi....
agar this aa gaya to usme parameter kaise aayenge
Sir kya aisa possible hai ki child constructor, parent constructor ko call hi na kare???
nhi bhai... its not possible because inherited instance variables ka initialization parent k constructor me hi hota he isliye parent ka constructor chalana zaruri ho jaata he
Sir Constructor Chaining ka advantage kya hain
Muhammad Adnan Akmal buddy if you want to prefrom a task in sequence as soon as your program run so for it you can use constructor chaining its mainly used in database connectivity
Increase quality
class A
{
int a;
public A()
{
System.out.println("default class A");
}
public A(int b)
{
a=b;
System.out.println("class A");
}
}
class B extends A
{
int b;
public B()
{ //*sir yaha par copiler super() nahi banata kyu?*//
super(5);
System.out.println("class B");
}
}
class ContructorInheritance
{
public static void main(String[] args)
{
B obj;
obj = new B();
}
}
because you have called for super(4) in the first line of the public B(){ super (4); }.
so, the control goes to public A(int b), instead of public A().
if you had called just super () , the control would have gone to only public A().
hope i have explained simply :-)
rupam sinha roy . Thanks for reply but actually I m learning now DBMS ... And I forgot some concepts in java . 😂. I have to revision about it .. after revision I will read ur reply
is video me mic ka gala kharab hogaya?
Sir your video is very useful to those person who will really want to learn java but they can understand java concept in colleges or tuition... and this video is also useful to me for learn java in detail ... thank u so much sir for providing this Video for us.