|
Java example source code file (RefTypes.java)
The RefTypes.java Java example source code/* /nodynamiccopyright/ hard coded linenumbers in other tests - DO NOT CHANGE * Debuggee which exercises various reference types */ abstract class AllAbstract { abstract void a(); abstract void b(); abstract void c(); } class AllNative { native void a(); native void b(); native void c(); } abstract class Abstract { abstract void a(); void b() { int x = 1; int y = 2; System.out.println("x + y = " + x + y); return; } } class Native { native void a(); void b() { int x = 1; int y = 2; System.out.println("x + y = " + x + y); return; } } abstract class AbstractAndNative { abstract void a(); native void b(); void c() { int x = 1; int y = 2; System.out.println("x + y = " + x + y); return; } } interface Interface { void a(); void b(); void c(); } interface InterfaceWithCode { String foo = new String("foo"); } public class RefTypes { static void loadClasses() throws ClassNotFoundException { Class.forName("AllAbstract"); Class.forName("AllNative"); Class.forName("Abstract"); Class.forName("Native"); Class.forName("AbstractAndNative"); Class.forName("Interface"); Class.forName("InterfaceWithCode"); } public static void main(String args[]) throws Exception { loadClasses(); } } Other Java examples (source code examples)Here is a short list of links related to this Java RefTypes.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
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.