fatbob_51
08-29-2007, 11:59 AM
Hi!
Im new to java and Im trying to do something really simpel, but based on objects....
What I have done so far is this:
//Importerar färdig skrivna paket med funktioner//
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class test
{
public static void main(String args[])
{
test();
}
public static void test()
{
System.out.println("hello");
}
}
But the thing is that I dont know how I'm supposed to call the object called "test"..if I even can call it and use it..since I have done this in JApplets before I thought it whould work here aswell...or something...
So to put my question easy, how do I create an object for a public void static main thing?
And I also have another question aswell, how do I "recall" variables from one object to another?, since most of my variables only seems to work within the object that its declared in...
Im new to java and Im trying to do something really simpel, but based on objects....
What I have done so far is this:
//Importerar färdig skrivna paket med funktioner//
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class test
{
public static void main(String args[])
{
test();
}
public static void test()
{
System.out.println("hello");
}
}
But the thing is that I dont know how I'm supposed to call the object called "test"..if I even can call it and use it..since I have done this in JApplets before I thought it whould work here aswell...or something...
So to put my question easy, how do I create an object for a public void static main thing?
And I also have another question aswell, how do I "recall" variables from one object to another?, since most of my variables only seems to work within the object that its declared in...