Considering the requests from some of my readers, I’m gonna start a new section in techblog that deals with java programming. These tutorials will start from the basic level so as to enable a novice to start programming in Java !
The classical way to begin programming in a language is by writing a program that prints a line or so.
And here is our first code:
1: public class NewClass {
2: public static void main (String arg [])
3: {
4: System.out.print("Welcome to Java tutorials section of TechBlog");
5:
6: }
7: }
You need to note that the name of the class “NewClass” should be the same as the name of the file we save (say, NewClass.java).
Though I like the command line way, I suggest all beginners to use an IDE. You can download my favourite IDE – Netbeans – from here.
Let’s go back to the code and review it:
You can see the use of three words – public, static and void in the line no 2. It means that the method main is accessible to all other classes and is ‘static’ (being main!). It is void since it is not returning any value – it merely prints a statement.
The part System.out.print commands the system to print the statement – "Welcome to Java"
And that’s it!
I will posting more tutorials soon. Stay tuned




Join Techblog
Facebook Group
Read
Digg entries
Add techblog to
Google reader