Skip to main content

Posts

Showing posts from March, 2018

What is system.out.println();

This is output statement.We use print() or println() method to print the message or value of variables. print() method is define under predefined class System (under PrintStream). print() method is called through out object which is also predefined. we can create own output object which call print() method. Example PrintStream myprint = new PrintStream(System.out, true); myprint.println("Hello World!"); How to find length of any word? Please see the below example carefully to know about System.out.println() .If you able to understand the example then you understand System.out.println() eaisly. Class Test { Static String s=“java”; } As you know here Test is a class. “s” is a static variable type String. Here “java” is nothing but the value of “s”. Now I am going to print the length(How many character) of “s”. So i am writing. Test.s.length(); Example Class System { Static PrintStrem out;