Team2/Creating a Java Class

From CDOT Wiki
Revision as of 23: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)
Jump to: navigation, search

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