Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #35378

Generics

Newsgroups comp.lang.java.programmer
Date 2016-08-17 11:59 -0700
Message-ID <681a67de-8a78-46ab-a028-5176a48df402@googlegroups.com> (permalink)
Subject Generics
From Eric Douglas <e.d.programmer@gmail.com>

Show all headers | View raw


Say we have 3 classes.

public class TestA<E extends TestB> {
}

public abstract class TestB {
}

public class TestC extends TestB {
}

Now we create an instance.

TestA<TestC> testMe = new TestA();

Now within class TestA how do we tell it instance testMe is referencing TestC?
The only thing I could find is to add a method or constructor which passes in a reference to TestC.class or the class name, so there's that for last resort, but I do want to make sure if I have to pass it in separately that it matches the value of E.

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Generics Eric Douglas <e.d.programmer@gmail.com> - 2016-08-17 11:59 -0700
  Re: Generics Marcel Mueller <news.5.maazl@spamgourmet.org> - 2016-08-17 21:20 +0200
  Re: Generics Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-08-17 15:22 -0400
    Re: Generics Eric Douglas <e.d.programmer@gmail.com> - 2016-08-17 14:03 -0700
      Re: Generics Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-08-17 20:06 -0400
      Re: Generics Robert Klemme <shortcutter@googlemail.com> - 2016-08-18 08:23 +0200
        Re: Generics Eric Douglas <e.d.programmer@gmail.com> - 2016-08-18 05:34 -0700

csiph-web