This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

interface

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hii
the other question here.

all interfaces are abstract, am i right?

then how can it be instantiated, n the code here is valid?

interface IFace{}


class CFace implements IFace{}

class Base{}

public class ObRef extends Base{

public static void main(String argv[]){

ObRef ob = new ObRef();

Base b = new Base();

Object o1 = new Object();

IFace o2 = new CFace();

}}


o1=o2

b=ob

o1=b
and if i insert these lines here all are valid how can ol=o2?

Edited by Corey McGlone: Fixed Misspelled Subject
[ May 28, 2004: Message edited by: Corey McGlone ]
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out this tutorial I wrote once upon a time. It probably has a lot more information than you need, but the answer to your question is there, as well. At the very least, I hope it's a useful read.
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic