Open main menu

CDOT Wiki β

Team2/Creating a Java Class

Revision as of 22:18, 2 February 2011 by Scborges (talk | contribs) (Created page with '=Guide Line= *To create a java class, right click on the package we created earlier (firstAPP) then highlight "New" and scroll down to "Class" *Under the name text box, enter "Lā€¦')
(diff) ā† Older revision | Latest revision (diff) | Newer revision ā†’ (diff)

Guide Line

  • To create a java class, right click on the package we created earlier (firstAPP) then highlight "New" and scroll down to "Class"
  • Under the name text box, enter "Lab1" and click on the button "Finish"
  • Copy and paste the following code
package firstAPP;

public class Lab1 {
    public int c = 4;
    public void printHello() {
        System.out.println("Hello");
    }
    public int returnC()
    {
        return c;
    }
}
  • We will be using this sample code as we continue with this tutorial