Pages

Wednesday, June 11, 2014

JAVA - Tutorial

class declaration:
       class MyClass {
                        // field, constructor, and
                        // method declarations
                        }
(OR)
        class MyClass extends MySuperClass implements YourInterface {
                // field, constructor, and
                // method declarations
            }

Modifiers:
             1) public
             2) private
Modifiers determine what other classes can access and can be added to the class at the begining as following
              public class MyClass {
                          // field, constructor, and
                         // method declarations
                                  }
(OR)
              private class MyClass {
                          // field, constructor, and
                         // method declarations
                                  }

In general, class declaration can be include these components, in order:
    1.Modifiers such as public, private, and a number of others that you will encounter later.
    2.The class name, with the initial letter capitalized by convention.
    3.The name of the class's parent (superclass), if any, preceded by the keyword extends. A class can only extend (subclass) one parent.
    4.A comma-separated list of interfaces implemented by the class, if any, preceded by the keyword implements. A class can implement more than one interface.
    5.The class body, surrounded by braces, {}.

2 comments:

  1. blue titanium | titaniumarts.com
    Blue titanium | TITaniumArt.com. Design, joico titanium design and titanium necklace development titanium bolt studio in everquest titanium South Bend, California. Made in Italy. Blue titanium art is titanium 3d printing

    ReplyDelete