hello
i am just a beginner of Java but i want know if i can declare a variable of any datatype and output its value using Sytem.out.println()
Tip: bookmark the API and learn to look things up there:
http://java.sun.com/javase/6/docs/api/
Using it you would see that System.out is of type
System.out.PrintStream
And that println is overridden to take a boolean, car, char[], double, float, int, long, String or Object. So pass it anything, but realize that if you are using the Object version and passing it a non-null reference, it will use the object toString method, which may or may not be what you want.
More generally, why not just try it and see what happens? It's faster that posting a question in the forum.
how this is possible
for(int i=0;i<10;i++);
please tell me
hanks in advance
I don't understand your question. Are you asking why that is legal syntax? It's beacuse of the empty statement.