Posted on March 12, 2009 by Narayan
As we know that java is made by the C programming. The java has many common features to C language. While we wants to print in java we usually use the following code.
System.out.println(statement1);
or
System.out.print(statement2);
But there is also the feature of printf in java which we used to do in C programming:
Syntax:
//In C language
printf(“format_string”, comma_separated_list_of_expressions);
Filed under: Classes | Tagged: C, java, print, programming, similarities | Leave a Comment »
Posted on March 6, 2009 by Narayan
Probably we used to declare the method and class as a public .
But the there is also the classes where there is no any public
or any private .
We can make two or many classes in a single class file.
* But when declaring numerous class the class file must contain
at least one public class whose class [...]
Filed under: Classes | Tagged: class, import, nonpublic, package, public | Leave a Comment »
Posted on March 1, 2009 by Narayan
The toString() method is one of the feature of java. It is the method of class String which is imported default on JVM from java.lang.Object;
ToString() method is one of the display method.
When ever we tries to print the text from System.out.println(“Hello”); then it directly inherit from the
Filed under: String | Tagged: defined, java, JVM, line, output, print, string, System, user, util | 3 Comments »