Java Interview Questions | Macbook Contest

preview_player
Показать описание
Check out our courses:

Coupon: TELUSKO10 (10% Discount)

For More Queries WhatsApp or Call on : +919008963671

More Learning :

Donation:
PayPal Id : navinreddy20
Рекомендации по теме
Комментарии
Автор

🤯 Method is NOT a polymorphism convinsed, ... Sir please take care ...

Wisdomizer
Автор

You are correct; you can instantiate an interface by creating an anonymous class that implements the interface. Here's an example:

```java
public interface MyInterface {
void myMethod();
}

public class Main {
public static void main(String[] args) {
MyInterface instance = new MyInterface() {
@Override
public void myMethod() {
System.out.println("Anonymous class implementing MyInterface");
}
};

instance.myMethod();
}
}
```

In the code above, we create an anonymous class that implements the `MyInterface` interface and provides a concrete implementation of the `myMethod` method. We then create an instance of this anonymous class and call the `myMethod` method on it.

So, while you cannot directly instantiate an interface, you can achieve it indirectly by creating an anonymous class that implements the interface and instantiating that class.

sumant
Автор

Sir Is there any pdf for java interview questions?

vamsikrishnasarukolla
Автор

What do tou think overriding is a polymorphism or not ?

Wisdomizer
Автор

Try with resources are used only with resources like db connections and file handling.

tanulakhwani
Автор

for freshers how you do interview means what you except from them

chanduyagnesh
Автор

Sir ...Maine spring security ke Kai sare vidio dekhe but muze samj me nhi aaya ki...how spring security work and how code flow means front end (React js) to backend ..
Plz make video on spring security for beginners...

And thank you for making such a interactive, interesting video for us...

Love your teaching style and voice...love from Beed Maharashtra.

shubhamghumare
Автор

Sir, can we call a method without knowing the method name, how?

chanduyagnesh