when Can an object reference be cast to an interface reference?
Answer / praveen kumar
.An interface reference can point to any object of a class that implements this interface i.e. see the example below:
interface Foo{
void display();
}
public class TestFoo implements Foo{
void display(){
System.out.println(“Hello World”);
}
public static void main(String[] args){
Foo foo = new TestFoo();
foo.display();
}
}
Is This Answer Correct ? | 0 Yes | 0 No |
What is meant by framework in java?
Topic- looping,function overloading,nesting ,polymorphism. Aim - to write a function with a name buzz-buds,that will check whether the given numbers are buddies or not on the basis of no. of parameters passed during function calling.
What does jpa mean?
Which interceptor is responsible for setting action javabean properties?
What is data encapsulation?
I am trying to create a new universal user group. Why can't i? : java security
Do I need to install jre if I have jdk?
Is jvm a compiler or an interpreter?
What is loose coupling in java?
Write a program for the following topic - switch case,looping using fuction calling,nesting,console input output. Aim- to print a menu:- 1-series 2-single value. Each menu having sub menu armstrong or perfect.
How do I run a java project?
Is eclipse a jdk?