Home Answers Viewqa Java-Interview-Questions Java interface reference

 
 


samar
Java interface reference
2 Answer(s)      2 years and 7 months ago
Posted in : Java Interview Questions

When can an object reference be cast to an interface reference?
View Answers

October 27, 2010 at 3:48 PM


Hi,

Here is the answer.

An object reference be cast to an interface reference when the object implements the referenced interface.

Thanks.


August 4, 2012 at 12:53 PM


Yes it is possible.The class which you want to cast,it should be implemented that interface . Example:

List<String> list=new ArrayList<String> ();

List is interface, and arraylist is implemented by list. so that we can cast it into list reference.









Related Pages:
Java interface reference
Java interface reference  When can an object reference be cast to an interface reference
Java reference
Java reference  What is weak reference in Java
interface.
interface.  Write short note on interface.   Please visit the following link: Java Interface
cross reference
cross reference   hi everbody as i got a problem and i have no idea the problem that i need to create a cross reference map for a Java source file. detail show below it mean that the input to the program is a Java source
Reference Data Types
Data Types in brief In Java a reference data type is a variable that can... to the corresponding interface class type: As you know that Java is an object-oriented... is called reference types in Java. The object becomes an instance when
INTERFACE
INTERFACE  how interface support multiple inheritance in java
interface
interface  What is marker interface ?? what is its use in java programming?? is this us in programming ??Explain is implementation with code
interface
interface  what the use of interface?   An interface is one... variables.Any class can implement(inherit)the interface and make use of the methods(functions) and variables within it. In java, multiple inheritance
pass method reference in java
pass method reference in java  How to pass method reference in Java
Interface
for Interface in java? and want to know why they used interface instead of multiple inheritance? Thanks in advance   An interface is one which has abstract... method it will take.It creates complexity.Therefore java uses Interface
interface
; Through interface, we can achieve the multiple inheritance. Java does...interface  What is the exact use of interface in real time scenario? some people says that interface provides multiple inheritance. Is it true
interface
interface  sir/mam, pls tell me how interfaces reduce duplicasy in java.. atul
interface - Java Beginners
Interface definition language example  example of interface definition  If it is a Class --> Interface is implemented. A class may implement multiple interfaces.if it is an Interface --> Interface can be extended
Interface - Java Interview Questions
Interface  Respected sir why we use Interface in java? because we... a new interface, you are defining a new reference data type. You can use... a reference variable whose type is an interface, any object you assign to it must
Reference passing in java
Reference passing in java  plz tell me wat d meaning of refernce in java? for example : Class M(){ N n; } Class N(){ } wats dis meaning
Pass by Reference - Java Beginners
by Reference?can u please explain with examples.is java supports Pass by reference...); } } Java programming language does not pass objects by reference...(i); display(i); } } Pass By Reference: It refers to pass an object
difference between hashcode,reference in java
difference between hashcode,reference in java  difference between hashcode,reference in java
java pass by reference
java pass by reference  i understood java always pass arguments by pass by value so that the original value does not change...... but i want to know how we change the value and make it effect the original value by passing
JdbcRowSet interface
JdbcRowSet interface In this section we will read about the JdbcRowSet interface in Java. javax.sql.rowset.JdbcRowSet is an interface which is a wrapper... the ResultSet objects scrollable and updatable. Object of interface
java call by reference - Java Beginners
affect the caller?s original variables. Java never uses call by reference. Java...java call by reference  in java do we have ane term like call by reference. if yes give me the full description with example and if no then also
call by reference - Development process
call by reference. Java always uses call by value. import java.awt.*; public...call by reference  Hello , Is thre callbyvalue in java... cannot change the caller?s reference variables, i.e. make them point to different
pass by value /reference - Java Beginners
pass by value /reference  hello sir/mam, i know pass by value is a primitive type in java. what about pass by reference in java ? .. For object type pass by value is used or pass by reference is used ? pls give me a example
Java Reference Books
Java Reference Books      ....     Java Reference Guide In the Java Reference Guide this week I present an MXBean monitoring Servlet
reference
reference of student into person can do like this or any other alternative Student
Reference Data Types
In this section we will discuss about Reference Data Types in Java 7
Java interface
Java interface  What is the List interface
Java interface
Java interface  What modifiers may be used with an interface declaration
Java Interface
Java Interface  Can an Interface have an inner class?  Yes, interface can have inner class. for example- public interface gyan { static...("in interface"); }; public static void main(String args
Java interface
Java interface  What must a class do to implement an interface?  It must provide all of the methods in the interface and identify the interface in its implements clause
Interface in java
Interface in java  An Interface method implemented in more than one different class with same method name. To avoid overriding of methods, we use ObjectReference for that class
java interface
java interface  Create a interface called student Define methods like get roll number Get name Get subject Create two classes Electronic student And history student Enter 5 students in the main class 2 of history and 3 elec
difference between the obj and reference - Java Beginners
difference between the obj and reference  what is the difference between object and reference ? is there any difference
Java simple reference source - Java Beginners
Java simple reference source  Hi, please could you recommend me a Java simple reference source (on line or e-book) where I could quickly find... would like to have a Java reference source for a quick look. I have got some
Reference type Vs Object type. - Java Beginners
Reference type Vs Object type.  Can anyone explain the exact difference between Reference and Object, how can i create a reference ? When exactly we have to use reference. Is this both terms interchangeble. Thanks
how do you parse by reference in java(with JGrasp)
how do you parse by reference in java(with JGrasp)  i am a 1st year beginner in java programming(GR 10) at hillcrest High School in south Africa My question is how do you parse by reference in java(with JGrasp) please help me i
Java Remote Interface
Java Remote Interface       The Remote interface identifies interfaces whose methods may be invoked..., but rather a reference to a stub object that implements the same interface as the remote
logfile interface
logfile interface  How to create logfile interface for programs in java
null interface
null interface   what is the null interface and what is the use of it in real java project ?   Hi Friend, A null interface is an interface... interface informs Java that objects of the implementing class can be serialized
Marker Interface,Java Marker Interface
Interface in Java       In this section we will learn about Interface and Marker Interfaces in Java... is also the interface's example. But in java programming language interface is nothing
Abstract and Interface
Interface and Abstract Class 1)Main difference is methods of a Java interface... declared in a Java interface is by default final. An abstract class may contain non-final variables. 3)Members of a Java interface are public by default. A Java
marked interface
marked interface  how jvm work with marked interface?(that means how it will know its behaviour with out any methods)   Hi, Learn it at Market Interface in Java tutorial page. Thanks
Java Naming and Directory Interface (JNDI)
Java Naming and Directory Interface (JNDI)       The Java Naming and Directory Interface (JNDI... similar to all Java APIs that interface with host systems. Moreover
Interface - Java Beginners
Interface in Core Java  What is Interface? How Can i Use Interface in Core Java
Markable Interface
Markable Interface  In Java can we create our own Markable Interface?? If yes then how, Please explain with example   Marker interface : In java language programming, interfaces with no methods are known as marker
Set interface
is the example of Set Interface in Java. import java.util.*; public class...Set interface  hello,, What is the Set interface?   hii, The Set interface provides methods for accessing the elements of a finite
Java cloneable interface
Java cloneable interface  What is cloneable interface
Java Interface
Java Interface In this section we will discuss about the interface in Java... interfaces. Interface in Java is created for referencing something to other. To create an interface in Java the keyword "interface" is used
JavaScript array object reference
JavaScript array object reference   ... that helps you in understanding JavaScript array object reference. For this we are using Java Scripting language. We declare an array variable that is used
With reference to the question " TELL US THE LOGIC OF DICEROLLER"???
With reference to the question " TELL US THE LOGIC OF DICEROLLER"???  Tell us the logic of diceroller 1 Answer(s) 18 minutes and 38 seconds ago Posted in : Java Beginners As told ""The (Math.random()*6)+1 returns the random
Java Serializalble interface
Java Serializalble interface  What is the difference between Serializalble and Externalizable interface

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.