How to call one constructor from the other constructor ?
answer : With in the same class if we want to call one constructor from other we use this() method. Based on the
number of parameters we pass appropriate this() method is called.
Restrictions for using this method :
1) this must be the first statement in the constructor
2)we cannot use two this() methods in the constructor
answer : With in the same class if we want to call one constructor from other we use this() method. Based on the
number of parameters we pass appropriate this() method is called.
Restrictions for using this method :
1) this must be the first statement in the constructor
2)we cannot use two this() methods in the constructor
β€4π1
which access modifier is the most strict(provides least visibility) in java
Anonymous Quiz
21%
public
51%
private
8%
default
20%
protected
π4
we try to bring lot of content, with great effort. Please subscribe to our youtube channel as token of appreciation of our work. Below is the link to our youtube channel.
https://www.youtube.com/c/frbjava
https://www.youtube.com/c/frbjava
π1
Anonymous Quiz
64%
Sequentialβββ
15%
Random
18%
Sequential and Randomββ
4%
None of the above
π3π₯2
Anonymous Quiz
33%
boolean a = 1;
12%
boolean _b = βfalseβ;
47%
boolean c = false;
8%
boolean d = βtrue:
π4π1
π₯4
Why a constructor cannot be final in Java?
Ans: If a method is marked as final it means we do not want any class to override it. As per Java Language Specification, a constructor cannot be overridden. So, there is no use in declaring a constructor as final.
Ans: If a method is marked as final it means we do not want any class to override it. As per Java Language Specification, a constructor cannot be overridden. So, there is no use in declaring a constructor as final.
π6
for more susch interview questions please follow our linkedin page
https://www.linkedin.com/feed/update/urn:li:share:7028945918791925760/
https://www.linkedin.com/feed/update/urn:li:share:7028945918791925760/
Linkedin
FRB Java on LinkedIn: #java
Why a constructor cannot be final in Java?
#java Ans: If a method is marked as final it means we do not want any class to override it. As per Java Languageβ¦
#java Ans: If a method is marked as final it means we do not want any class to override it. As per Java Languageβ¦
π1
π2
Newly Joined Members subscribe to our channel to learn programming and crack written exams.
https://tinyurl.com/dzrt4f7d
Discuss doubts in @tcs_infosys_accenture
https://tinyurl.com/dzrt4f7d
Discuss doubts in @tcs_infosys_accenture
π1
Anonymous Quiz
7%
C++
15%
J++
74%
OAK
4%
TEAK
π3
π9β€1π1π1
π3β€1π1
Newly Joined Members subscribe to our channel to learn programming and crack written exams.
Click on below link to subscribe
https://tinyurl.com/dzrt4f7d
Discuss doubts in @tcs_infosys_accenture
Click on below link to subscribe
https://tinyurl.com/dzrt4f7d
Discuss doubts in @tcs_infosys_accenture
π1
Anonymous Quiz
2%
.j
1%
.ja
94%
.java
3%
.jax
π4
Anonymous Quiz
31%
method
21%
native
19%
reference
28%
array
π4π₯°1π1
Forwarded from TechShiksha by Badkul Technology (admin)
Newly Joined Members subscribe to our channel to learn programming and crack written exams.
Click on below link to subscribe
https://tinyurl.com/dzrt4f7d
Discuss doubts in @tcs_infosys_accenture
Click on below link to subscribe
https://tinyurl.com/dzrt4f7d
Discuss doubts in @tcs_infosys_accenture
π₯°4