alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java example source code file (Neg13.java)

This example Java source code file (Neg13.java) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

class, neg13, object, string

The Neg13.java Java example source code

/* @test /nodynamiccopyright/
 * @bug 7192246
 * @summary check that default method overriding object members are flagged as error
 * @compile/fail/ref=Neg13.out -XDrawDiagnostics Neg13.java
 */
interface Neg13 {
    default protected Object clone() { return null; } //protected not allowed here
    default boolean equals(Object obj) { return false; }
    default protected void finalize() { } //protected not allowed here
    default Class<?> getClass() { return null; }
    default int hashCode() { return 0; }
    default void notify() { }
    default void notifyAll() { }
    default String toString() { return null; }
    default void wait() { }
    default void wait(long timeout) { }
    default void wait(long timeout, int nanos) { }
}

Other Java examples (source code examples)

Here is a short list of links related to this Java Neg13.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.