Q - can we print something on console without using main method ? Ans - Until java 1.6 it's possible by using static block ,but from java 1.7 onwards we can not execute java program without main method.
Question - Can functional interface extend another interface ? Answer based on chatGPT - Yes, a functional interface in Java can extend another interface. If the interface it extends is also a functional interface, the resulting interface will still be a functional interface as long as it has exactly one abstract method. @FunctionalInterface interface ParentFunctionalInterface { void parentMethod(); } @FunctionalInterface interface ChildFunctionalInterface extends ParentFunctionalInterface { // No new abstract methods, still a functional interface } public class FunctionalInterfaceExample { public static void main(String[] args) { // Using lambda expression to implement the method ChildFunctionalInterface child = () -> System.out.println("Implementation of parentMethod"); child.parentMethod(); } }
agar static block ke ander v agar kuch print kerna ho toh main method chaye without main method ke program output ne dega ok and i know when class is loaded static block is executed but main method v hona chaye
Wrong answer function interface can extend another implamentation as long as you dont break pricipal of output that this method should cpmplete one task only. 😊
i think the first question is poorly formed, because without main method any class cant be initialized for example let's suposse that i have my Main class class Main { static { System.out.println("Hello world!!"); } } This code is just useless without a main method, the thing is that i need to run my java class to allow the static block to be initialize.
Is this guy really having 3 years of experience my god from start to end she is only asking and answering As a fresher I felt interesting and easy question I m able to answer them.
I really like the way she explains when answer given by the candidate is not clear. Quality content 🤟 keep them coming.
Q - can we print something on console without using main method ?
Ans - Until java 1.6 it's possible by using static block ,but from java 1.7 onwards we can not execute java program without main method.
We can do it by using java interpreter even after java 1.8 onwards
@@diwakarreddy7478 no we can't tried
till java 1.6 i can run java program without main method as well as without static or instance block
till jdk 1.6 i can run a java program without main method as well as without static block
Questions asked by her are very good....i really learnt lot from this video!!
Question - Can functional interface extend another interface ?
Answer based on chatGPT - Yes, a functional interface in Java can extend another interface. If the interface it extends is also a functional interface, the resulting interface will still be a functional interface as long as it has exactly one abstract method.
@FunctionalInterface
interface ParentFunctionalInterface {
void parentMethod();
}
@FunctionalInterface
interface ChildFunctionalInterface extends ParentFunctionalInterface {
// No new abstract methods, still a functional interface
}
public class FunctionalInterfaceExample {
public static void main(String[] args) {
// Using lambda expression to implement the method
ChildFunctionalInterface child = () -> System.out.println("Implementation of parentMethod");
child.parentMethod();
}
}
The child interface is not functional interface right ? So it can extend interface with one abstract method which is functional interface
@@ashishkatkar6595 child interface is also functional interface right. if iam wrong can u explain
Bro can you provide java back end interview questions and answers answers ekkada vetikina chala clumsy ga vasthunai
She explains very well
This is informative for uploading interviews. Keep uploading .
It was very helpful basically the interview was done like a corporate level
I really loved it..
Guys do like this..❤❤
Regarding hashmap. Question could be clear if she asked Can we have Objects as key for hash map.
Yes
Actually if he has 3 yrs experience he must know about main method and static concept bcz it is foundation concept
Good explaination by the interviewer👍
If possible please share the questions in description or pinned comments as well.
Okay sure
Nice content with beautiful interviewer ...
agar static block ke ander v agar kuch print kerna ho toh main method chaye without main method ke program output ne dega ok
and i know when class is loaded static block is executed but main method v hona chaye
Thank you very much ❤
Very helpful for me....
Explanation for every question-answers are very good 👍 thanks 🙏🏻
I think first question is wrong only static block is there then it will through error if main method not there
It was possible to print anything on console without main method before java 1.6 but later version will throw MethodNotError.
Wrong answer function interface can extend another implamentation as long as you dont break pricipal of output that this method should cpmplete one task only. 😊
I am looking for job change for java developer of experience 3.2 yrs.how to get demo interviews?
Thanks for the video.
Good Interviewer
Hi sir I love ur videos
I'm 2 years experienced java dev.. Planning to shift.. Neeed ur guidance sir
How can I help you?
Tomcat is the Spring boot default server
what is the source used for these questions?
Watch our videos
He doesn't know the types of servers whichever he was use.then how interviewer believe they have 3 yr exp 😂
SIB doesn't work without main method !!
Who is interviewing whom in this video?
i think the first question is poorly formed, because without main method any class cant be initialized for example let's suposse that i have my Main class
class Main {
static {
System.out.println("Hello world!!");
}
}
This code is just useless without a main method, the thing is that i need to run my java class to allow the static block to be initialize.
Too many adds disturbing totally 😢
14:00 oh this guy is from covid batch for sure.
😂😂
tomcat, jetty are widely used for anyone looking for answer
In reality does sm1 get selected after answering this much?
No, as per my experience.
Did he get selected?
Guy has not worked on any development project.
How bro
3 years experience? Really?
I kinda surprised tho 😅
She's good
Sib
So
Ankit Kumar pubg khela band kro
Is this guy really having 3 years of experience my god from start to end she is only asking and answering
As a fresher I felt interesting and easy question I m able to answer them.
Why doesn't she focus on which project he worked
Same 😅