Main Menu

friends

Banner

Latest articles

very simple mysql connection from php
01/01/2010 | mad mad mod

This article describes how to connect to a mysql database from a php script. It is realy the most simple way of using mysql databases in php, no fancy wrapper classes, no functions and NO security! W [ ... ]


How to run a command in the background or after you exit from a shell prompt
10/03/2010 | mad mad mod

Solution 1: use "nohup" example:[root@blackmod ~]# nohup sleep 1234 &
nohup: ignoring input and appending output to `nohup.out'
[1] 2800
[root@blackmod ~]# exit
logout
 logon again and check the  [ ... ]


Other Articles

Designed by:
SiteGround web hosting Joomla Templates
Hello World in java E-mail
programming

This article describes how to write, compile and execute a "Hello World" program in java on Linux (Fedora).

 

1. the prerequisites

 

2. write the code


open an empty file with a text editor (e.g. vi):


# vi HelloWorld.java



now write the following code into the sourcefile:

public class HelloWorld {
public static void main( String args[] ) {
System.out.println( "Hello World!" );
}
}



save the file and exit vi with ":wq + enter"

 

important: the source file must have the same name as the public class (HelloWorld.java)

 

explanation


public class HelloWorld {

}

our "main" class is called HelloWorld. public indicates that the class can be used by any program or user.

 

public static void main( String args[] ) {

}

The main method ist where the execution of the class starts. void indicates that the method does not return any value.

 


System.out.println( "Hello World!" );

This prints out the string "Hello World!"

 

 

3. compile into bytecode



# javac HelloWorld.java




This produces an file called "HelloWorld.class".



4. run the program


you can now execute the bytecode with:


# java HelloWorld
Hello World!

 

 

 

Comments (0)
Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:D:angry::angry-red::evil::idea::love::x:no-comments::ooo::pirate::?::(
:sleep::););)):0
Security
Please input the anti-spam code that you can read in the image.

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

 
mad mad mod, Powered by Joomla! and designed by SiteGround web hosting