Sample of java program



Sample of java program to print " Hello Java" on screen with short

 description to easy understand the java program.


Sample Program


public class Hello
{
public static void main ( String args[] )
{
System.out.println("Hello Java");
}
}


     class name and file name are same.

     public is a access specifier this define the scope of the method or class.

     static means that method is associated with the class, not a specific instance(object)
     of  that class.

    void specify the return type of the method.

    array args[] is a String array use to get value from command line argument.

    In System.out.println()
            - System is a in-built class which is present in "java.lang" package.
    - out is a static final field (ie, variable) in System class which is of the type
               PrintStream ( a built-in class, contains methods to print the different data values ).
    - println() is a method use to print any message in nee line. we also use print()
               method is to print message is current line.

    how to compile ?
    javac programName.java;
    ex:-  javac Hello.java;

    how to Run ?
            java MainClassName;
    MainClassName means class which contain main method.
    ex:- java Hello

    O/P :-

































Basic Commands for Unix

 Hello friends, Here I am going to explain you all the basic command for the Unix. So you can handle system or access the data through the terminal.

       Commands :


>>Basic Commands


1)  cal : 

The cal command is used to to display the calender.
For example to check calendar you need to type cal command as follows:

               

2) passwd

The passwd command is used to change the password of the unix system. Every unix system will require a password for the security.





3) whoami, who, user

The who am i  command is used to know the name of the user by which you are currently logged in.
The who command is used to know the name of the user who are online on connected system.
The user will display the name of the users.



                                >> File Management Commands<<

4) ls command

The ls command is used to list the directories and files of the current running directory with the 
-l option.
As shown below example d stands for the directory and - is for the executable file like text file, image or any other format.




5) cat

The cat command is used to read the file. We can also create the file with the cat command by using >  sign with it. as seen below example :




6) wc (word count) command

The wc command is used to count the number of characters, words and lines of any file.
In wc  command -c for character, -w for word count and -l for line count

Syntax  $wc <filename>





7) cp command

To make a copy of a file use the cp command. The basic syntax of the command is:

Syntax :
                  $ cp source_file destination_file





8) mv Command 

The mv command is used to rename the filename

Syntax :
                 $ mv old_file new_file




9) rm Command 

The rm command is used to remove the particular file.
It is recommended to use -i option along with rm command.

Syntax :
               rm <filename>




Step to set the the path of JDK (Java Development Kit)

Step 1.  Download JDK ( Depend on your windows version compatibility ).

Step 2.  Install JDK.

Step 3.  Set the System variable path (eg. Win8).

          Open MyComputer properties.


  Click on "Advance System setting".


Click on "Environment variable..".


Drop-down list of "System variable" select the variable "Path".  
          Click on edit button.

 
Set the cursor on last position in variable value.
          Then write semicolon(;) then write the path of bin folder of JDK.


Basic of Java

Introduction

        Java is an object oriented programming language and a platform developed by the  James GoslingMike Sheridan, and Patrick Naughton initiated the Java language project. The small team of sun engineers called Green Team. in June 1991.
It is a fully platform independent language  

Platform Independent  Any hardware or software environment in which a program runs, known as a platform. Since Java has its own Runtime Environment (JRE) and API, it is called platform
                    Thus the system which have a support to the java platform can run the java program their is no any changes is required in the program. Their is only the java class files are used which are a intermediate code generated by the compiler.
                      In java the Intermediate code is generated by the Compiler are used by the Java Virtual Machine (JVM)  and it  converts its into the machine code to execute the program.