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

Scala example source code file (nest.java)

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

Java - Scala tags/keywords

inn, inn, outer, outer, protinn, protinn, string, string

The Scala nest.java source code

package nestpkg;


/** This file is needed for test 'nest.scala'. It should
 *  be compiled with javac and packaged into lib/nest.jar
 */
public class nest {
    public static class best {
        public static class rest {
            public static rest test = new rest();
            public static int  x = 10;
            public int inc(int i) {
                return i + 1;
            }
        }
    }


    String name = "Outer name";

    public class Inn {
        int x;

        public Inn(int x) {
            this.x = x;
        }

        public void doSomething() {
            System.out.println("Inn " + name + " x: " + x);
        }
    }

    protected class ProtInn {
        public void doSomething() {
            System.out.println("ProtInn " + name);
        }
    }
}

Other Scala examples (source code examples)

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

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

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 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.