Hello Mukesh, Another excellent lesson. You are class apart on KZbin. You make it so easy to understand the concept. Cant thank you enough🙏
@Mukeshotwani2 жыл бұрын
Hi Reshma, thank you so much for such a nice comment. It made my day. Keep learning.
@afsalsb78764 жыл бұрын
Ohh my god, no video better than this in youtube about constructor,शाबाश
@Mukeshotwani4 жыл бұрын
Thanks Afsal bhai..
@sourabhyadav5963 жыл бұрын
Whole series is really helpful for me... great work
@Imran-M-4 жыл бұрын
Hey Mukesh, thanks for the tutorial! Could you please clarify the following? rest all are clear.. 1. @1:45, can you explain with example why constructors cannot be synchronized and what happens if we try to make them as such? 2. @17:46, why did you write result = marks; and not this.result = marks; as result being a non static variable. Is it because the rule to write non static variables directly in non static methods also apply for constructors?
@Mukeshotwani4 жыл бұрын
HI Imran, I really appriciate your dedication for learning, for first point The JVM ensures that only one thread can invoke a constructor call at a given point in time. That is why no need to declare a constructor as synchronized and it is illegal in Java. Second point- Video coming for this on Wednesday. Quick point- if global variable and local variable have different name then no need of this keyword.
@Imran-M-4 жыл бұрын
@@Mukeshotwani Thanks Mukesh for the clarity, looking forward to the video ✌
@arabindamohanty21904 жыл бұрын
Very nicely u explained the concept thank you
@Mukeshotwani4 жыл бұрын
You are most welcome Arabinda
@farzanfarooqui51593 жыл бұрын
Thanks!! brother 👍 well explained!
@Mukeshotwani3 жыл бұрын
Glad it was helpful! Thanks Farzan
@sushantpawar313 жыл бұрын
Great session .
@Mukeshotwani3 жыл бұрын
Thanks Sushant
@sankarsan4 жыл бұрын
Thanks a lot Mukesh.
@Mukeshotwani4 жыл бұрын
Keep watching Sankarsan
@rashmipatel69964 жыл бұрын
Hi Mukesh, thanks for this video. clear explanation of the concept. Please also upload list of frequently asked java programs.
@Mukeshotwani4 жыл бұрын
Yes will try my best Rashmi
@nainagupta49492 жыл бұрын
Hello Sir, I got confused with scenarios like the default constructor creates when we create the object then what is need of creating the constructor as separate ???
@tapaskhandai Жыл бұрын
Hi Mukesh, Could you please make a video on the constructor role in POM. How it works? Why we need to create a constructor in every page? What will happen if we dont create constructor?
@pranalilanjewar42933 жыл бұрын
Hi Mukesh, Thanks for the above video, I understand the Constructor concept but i have question here , when we have to use this constructor in real scenario?
@Mukeshotwani2 жыл бұрын
Hi Pranali, First link of Selenium itself we can implement this. Example WebDriver Driver=new ChromeDriver() DesiredCapabilities caps = new DesiredCapabilities(); caps.setHeadless(true); WebDriver driver = new ChromeDriver(caps)
@ankitshrivastava17722 жыл бұрын
Hi, Mukesh can we create any method inside the constructor?
@Mukeshotwani2 жыл бұрын
Nopes, you can call method from cons and you can also another cons from same class (using this) and base class cons using super.
@ankitshrivastava17722 жыл бұрын
@@Mukeshotwani Thanks.👍
@hamzaahmed61314 жыл бұрын
Hi Mukesh thanks for a clear explanation of constructor, can you please make another video on copy constructor concept as well
@Mukeshotwani4 жыл бұрын
Sure Ahmed will make soon on this, but we dont use copy constructor in real time in Selenium
@atulthorat56704 жыл бұрын
Thank you Mukesh!
@Mukeshotwani4 жыл бұрын
Thanks Atul, Now a days seems you are not watching youtube 😂
@divyangjani76004 жыл бұрын
sir one thing is copy constructor.. can you explain what is it?
@Mukeshotwani4 жыл бұрын
Hi Divyang copy constructor accept an object of the current class and initialize the values of instance variables with the values in the obtained object public Student(Student std){ this.name = std.name; this.age = std.age; }
@97457549044 жыл бұрын
Wats the use of counstructor
@Mukeshotwani4 жыл бұрын
watch the video till end,I have explained by taking Selenium example
@97457549044 жыл бұрын
@@Mukeshotwani yes mukesh, my doubt was if setheadless is implemented in a function rather that in a constructor , and if we acess that by creating object, then there is any use of constructor.sorry if I. Asked any silly, just clarify all. Doubts
@Mukeshotwani4 жыл бұрын
Hi Jino setHeadlessMethod is part of ChromeOption class and ChromeDriver has one constructor which accepts ChromeOption object as parameter
@97457549044 жыл бұрын
@@Mukeshotwani thanks mukesh
@theRandom_Guy1513 жыл бұрын
Why does a constructor name is always the same as class name. Why cant we use a different name?
@Mukeshotwani3 жыл бұрын
Hi Dipankar if you use other name it will become method