You learn how to write programs by writing programs.
But you gotta start small, man.
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } From there, begin building...
public class HelloWorld { static String test = "This is a test"; public static void main(String[] args) { System.out.println(test); } } and then...
public class HelloClass { String test; public void setTest(String str) { test = str; } public String getTest() { return test; } } public class HelloWorld { HelloClass myHelloInstance; public static void main(String[] args) { myHelloInstance = new HelloClass(); myHelloInstance.SetTest("Hello World.") String myResult = myHelloInstance.getTest(); System.out.println(myResult); } } ... and so on. Once you understand the basics of how objects work, it will be much easier to write larger programs.