• Sunday, August 31, 2014

    4 Java - Basic about Java Classes, Objects and Instance.

    Syed Masoom Rizvi

    JAVA Classes, Java Objects and its Instance

    Java Classes
    In Java, codes are written under a body called class.

    Example: a class with name "MyClass

    class MyClass

    {


    }


    Objects and Instance

    Objects are the real world character created in Java.

    Saturday, August 30, 2014

    3. Java- A HelloWorld Example

    Syed Masoom Rizvi
    Firstly read out few basic rules for java:
    • A class name should be started with a capital letter. Example: HelloWorld.
    • A variable started with small letter. If variable is create by joining two word example : fuel and available then it should be written as fuelAvailable. Same case with function also.
    • Function must have a written type like: void or int or String.... Example: int getFuel(){}, void destroy(){}.
    • In Java, there is no value of new line. You can write all the codes in single line. 

    Now we start a HelloWorldExample:

    2. Learn Java Basics for Beginners

    Syed Masoom Rizvi

    Java Basics

    Java is object oriented programming language, which is easy to learn, compile and run on any Operating System. Java Programs are run by Java Virtual Machine(JVM).

    Every Java Program have a class. Basically a class is a set of variable and functions.
    Example:

    A car of blue color having functions like blow horn, turn light on or off, drive, show Fuel Available.
    In java this can be written as: