Thread: Strange
View Single Post
Old 01-28-2013, 03:50 PM   PM User | #6
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,650
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Quote:
Originally Posted by Zaid View Post
I use the code
Code:
import java.lang.System;
class Demo
{
	public static void main(String args[])
	{
		out.println("Hello");
	}
}
but it is not working.....so u said wrong....and plz don't try to confuse me(with all those PHP's and irrelevant ****) when u seriously don't know the answer...
I beg your pardon? Perhaps you are looking at my signature.
You are obviously not reading what I said:
Quote:
But for shortcut (ie: lazy ) usage, you can use it against the system.out for example, so you can just type in out.println. Unlike C#/VB, you can't get to the println this way as the PrintStream is an instance object and not a class.
You *must* have an instance of Java's PrintStream in order to invoke the println. The System.out is a static instance of PrintStream.
PHP Code:
import static java.lang.System.out// You cannot statically import System.
public class myclass
{
    public static 
void main(String argv[])
    {
        
out.println("Hello world");
    }

Quote:
Originally Posted by Zaid View Post
Didn't buy it....
Unlike Java, C# uses a static console and static WriteLine. You can import the System.Console directly and invoke the methods without referring to the class.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php

Last edited by Fou-Lu; 01-28-2013 at 04:02 PM..
Fou-Lu is offline   Reply With Quote