Java Class 2 & 5
By: Brooke Simspon and Jackson Suggs
Class 2
Creating a Java Project
- Start Netbeans
- Go to file
- Click on Project Group
- Hit new group
- Assign a name
- Now create a new project
- Choose a project type
- Assign it a name
New Projects
New projects start with information added by default. Although it's useful because it gives a basic structure it needs to be changed unless you want your first comment to be, "To change this license header, choose License Headers in Project Properties."
Comments
- A comment begins with */
- It ends with /*
- A comment provides some general information, generally about the program
- Program headers are comments at the beginning of a program
- Program headers are used to give users a little info about the program
Methods
- A method is where a Java program performs a task.
- The main method is the central command of the program
- Methods can command lines to be displayed or die to be rolled
some java basics
- With Java you have to be specific, commands with the same meaning won't give the same results.
- Upper and lower case letters make a difference
- Java ignores white space (blanks)
- White spaces can in fact be used to make code easier to read while not changing the process
- Curly braces are used for grouping, and mark the beginning and end of programming sessions
- A wall of code is called a block
- Indent code within a block for easier reading
- A semicolon ends a statement
- A statement is a program that generates an action
How java runs
Java program -> Java Compiler -> Java object code
(.java file)_________________________ (.class file)
Java object code -> Java Virtual Machine -> Java Program on your computer
(.class file)_________________________________ (Java interpreter)
(.java file)_________________________ (.class file)
Java object code -> Java Virtual Machine -> Java Program on your computer
(.class file)_________________________________ (Java interpreter)
File Types
- Only .java and .class files are true java files
- Other files may be present in your java folder, however these are particular to your medium (in this case Netbeans)