Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java namespaces

Name: Anonymous 2013-12-05 12:37

It always annoyed me that Java has no formal support for structural or procedural programming, but still tries to hack it in with the "static" keyword, effectively turning classes and interfaces into namespaces. What if namespaces were included in Java 8? They'd be identical to classes, but all their members would be public and static by default. Example:


public namespace Math
{
    final double PI = 3.141592654; //public and static by default

    double abs(double a) //public and static by default
    {
        ...
    }

    ...
}


Am I a genius or what?

Name: Mr. Irrational 2013-12-05 17:14

Java has plenty of support for procedural programming i.e. ;.

And Java jas plenty support for structural programming too e.g. for, while etc.

What you want is reasonable, but it is not called what you think it is called.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List