Ads Sponsored By Google :)

Wednesday, 23 January 2013

explain|explanation of system.out.println in java means|syntax


System.out.println in java java system.out.println system.out.println java explain system.out.println in java
system.out.println in java system.out.println hello world System.out.println in java explain System.out.println in java system.out.println explanation explain system.out.println means  explain system.out.println syntax explain system.out.println in java syntax of system.out.println in java system.out.println in java means


Expalnation for System.out.print() and System.out..println() methods or statements:

1)      System.out.print():
      This statement is used for displaying the result of java program on the console in the same line.

2)       System.out.println():     
      This statement is used for displaying the result of java program on the console line by line.
           Here itself the following code segment give awareness about usage of about two statements.

   //Internal coding in java jdk api

              a)      Here in it one class PrintStream contains println() and print() methods.
     
           Class PrintStream
          {
             Public void println()
            {
              // logic printing output on the screen and after goes to next line
             }
              Public void print()
            {
             // logic printing output on the screen and after it remains in same line
              }
           }

           b)      Here in it another class System creates static PrintStream class object(out) by
             using dynamic allocation operator new.
   
           Class System
         {
            Static PrintStream out=new PrintStream();
          }

        c)      By using that static PrintStream class object(out) we can display the data in whatever  
                 manner(i.e line by line or in same line).
     
         Class demo2
        {
            Public static void main(String args[])
           {
            System.out.println(“Hello java world”);
            System.out.println(“javajavax.blogspot.com”);
           }
         }

No comments:

Post a Comment

LinkWithin