Jul 6, 2014

Java Variables and Printing Values

Open Text File & Save As JavaVariables.Create The Class and Main Method Inside It.

class HelloWorld {
   public static void main(String args[]){

   }
}

Now We Have Our JavaVariables Class. Inside The Class We Can Create Our Variables.I'm Creating  Variables All Together And Printing All.

class HelloWorld {
   public static void main(String args[]){
      String SName = "Nifal Nizar";
      int age = 24;
      System.out.print("My Name Is ");
      System.out.println(SName);
      System.out.print("I am ");
      System.out.print(age);
   }
}

You Will See The Out Put As
My Name Is Nifal Nizar
I am 24

If We Are Using print Method It Will Print The Text And Wait In The Same Line.But If We Use println Method It Will Print The Text and It Will Go To Next Line.


No comments:

JWT Token Decode Using Jquery

When it come to authentication we use many mechanism. Ones the user authenticated we must keep these details somewhere safe. So we can share...