Tabnine Logo
Giraffe
Code IndexAdd Tabnine to your IDE (free)

How to use
Giraffe
in
org.jboss.cdi.tck.tests.event.observer.extension

Best Java code snippets using org.jboss.cdi.tck.tests.event.observer.extension.Giraffe (Showing top 6 results out of 315)

origin: stackoverflow.com

setOfAnimalByClass.get(Giraffe.class).add(new Giraffe());
origin: stackoverflow.com

 Scanner scanner = new Scanner(System.in);
System.out.println("Name your giraffe.");
String name = scanner.nextLine();     // get user input for name

Giraffe giraffe = new Giraffe(name);  // use the constructor above to set name

System.out.println(giraffe.getName());  // prints name of giraffe
origin: stackoverflow.com

 List<Animal> animals = new ArrayList<Animal>(); // List
animals.Add(new Lion()); // Order 0
animals.Add(new Giraffe()); // Order 1
animals.Add(new Zebra()); // Order 2
origin: stackoverflow.com

 class B<T> {
  private T thing;
  // I thought one could do generic parameter types in constructors as well?
  public B(T thing) { this.thing = thing; }
}
class C {
 public void whatever() {
  Animal f = new Giraffe();
  addThing(f);
 }
 protected <K> void addThing(K object) {
  // if you need reflection, object.getClass() will be the K type at run time.
  process(new B<K>(object));
 }

 // process method elided
}
origin: stackoverflow.com

 public class Main {

    public static void main(String[] args) {
      Zoo z1 = new Zoo("Zoo1");
      Zoo z2 = new Zoo("Zoo2");

      Animal pen1 = new Penguin("Luke");
      Animal gir1 = new Giraffe("Duke");
      Animal pen2 = new Penguin("Fluke");
      Animal tig1 = new Tiger("Brooke");

      pen1.setZoo(z1);
      pen2.setZoo(z2);
      gir1.setZoo(z2);
      tig1.setZoo(z2);

      System.out.println(pen1.belongsWhere());
      System.out.println(tig1.belongsWhere());

      System.out.println(z1); System.out.println(z2);
    }
}
origin: org.jboss.cdi.tck/cdi-tck-impl

protected void testNotifyInvokedInternal() {
  reset();
  Giraffe payload = new Giraffe();
  fireEvent(payload);
  verifyObserversNotNotified(extension.getFiveMeterTallGiraffeObserver(),
      extension.getSixMeterTallAngryGiraffeObserver(), extension.getAngryNubianGiraffeObserver());
  verifyObserversNotified(payload, extension.getAnyGiraffeObserver());
}
org.jboss.cdi.tck.tests.event.observer.extensionGiraffe

Most used methods

  • <init>
  • getName

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now