Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Threaded View

  1. #1
    Junior Member pyler's Avatar
    Join Date
    Sep 2012
    Posts
    23
    My Mood
    Busy
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Default Declaring an object using an interface implemented by its class vs declaring an object using the class

    Suppose you have a generic Dog class of the pet type that implements a DogInterface of the pet type. What is the difference between;

    DogInterface<pet> Rex = new Dog<pet>();
    and
    Dog<pet> Tye = new Dog<pet>();

    In what situations might you want to use Rex instead of Tye?
    Last edited by pyler; April 9th, 2014 at 04:37 PM.


Similar Threads

  1. [SOLVED] Need help, Object Oriented / Class & Object.
    By jedmustdie in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 23rd, 2014, 10:21 PM
  2. What is the difference in declaring class variables?
    By Robertgif in forum Java Theory & Questions
    Replies: 3
    Last Post: September 18th, 2013, 12:52 AM
  3. having problem declaring a generic type array in OrderSet class
    By mia_tech in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 10th, 2012, 06:39 PM
  4. Convert File Object to class<?> object
    By CEO in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: June 27th, 2012, 06:55 PM
  5. <..> when declaring a class
    By Asido in forum Java Theory & Questions
    Replies: 1
    Last Post: September 8th, 2010, 08:47 AM

Tags for this Thread