Java Netbeans IDE Function
Prepares the environment for developing java applications
IDE Full form
Integrated Development Environment
Java Netbeans
Platform to write Java code and applications (Version 7 ngayon)
What does java develop?
Desktop applications, client-server applications, mobile phone applications, games
Java major advantage
Platform independent
Java’s own runtime environment
Java Virtual Machine (JVM)
Current owner of java
Sun Microsystems
What to download?
Java Virtual Machine (JVM) and Java Development Kit (JDK)
Java code to write & extension
Source code wiith .java extension
What compiled the source code?
Another program called Javac that turns it into a Java byte code with .class extension (there should be no present errors)
File that Java Virtual Machine runs
Class file
Java Comments
Grayed out areas with forward slashes (// for single line comments; /* */ for multiline comments and asterisks that the compiler ignores
Javadoc comments
Starts with /** ends with */ to document the code (converted to HTML)
Java is case sensitive
True
Java code instructions end with a
Semicolon (;)
public class MyFirstProgram { }
Class segment notes the starting and ending of a java class segment code
Public static void main(String[] args){ }
Method
Public in “public static void main(String[] args){
the code can be accessed outside the class without creating new objects
Void in “public static void main(String[] args){
This part of the code does not return any value
Main in “public static void main(String[] args){
Denotes starting point of the java program
IntelliSense
NetBeans tries to display a list of available options after “.”
.Jar file (java archive) function
Cleans and builds your project with all necessary files for export if the program needs to be shared; will be put in a dist folder
Data
can be text, numbers, pointers, objects or some specified memory location
How is data accessed
Concatenation
Joining together direct text and a variable
You cannot start with a number for a variable name
True
You cannot have the same variable name with a keyword
True
Variable names can have a space
False
Variable names are not case sensitive
False
Java minimum and maximum value for numbers
+-2147483647 (use double to get a bigger/smaller number)
Operator Precedence
Order in which arithmetic’s operations are executed
Priority in operators
Multiplication & Division > addition and subtraction
Double quotes
String variable
Single quotes
char variable
Import java.util.Scanner; function
Tells java you want to use the scanner class in the util package of java library
Import in Import java.util.Scanner;
Reference it in the code
Scanner in Import java.util.Scanner;
Class that handles inputs
Util in Import java.util.Scanner;
utility package of the java library where scanner is stored
Scanner variable
Scanner user_input = new Scanner (System.in);
New in Scanner user_input = new Scanner (System.in);
Creates the new objects
System.in in Scanner user_input = new Scanner (System.in);
Specifies for system input
User_input in Scanner user_input = new Scanner (System.in);
TThe variable that is called to call the input methods
Next method in Scanner user_input = new Scanner (System.in);
Gets the next string of text or int of number that a user types
Println
Cursor moves to a new line after the output
Cursor stays on the same line
If statement format
if(Condition {//codes to be executed if true}
Comparison Operators
Greater than, < Less than, >= greater or equal to, <= less than or equal to
Logical Operators
&& AND, || OR, == HAS A VALUE OF, ! NOT
If else statement structure
if(condition){code to be executed} else {code to be executed}
Nested IF statement
IF statement inside another IF statement
Boolean values
One with two choices: True or false, yes or no, 1 or 0
Switch statement
Selection statement
Switch statement can be used instead
Switch statement structure
switch(your test variable) { case Testing value: statement to be executed; break; default: statement to output if no matching case found; }
Looping
Repeat execution of statements a number of times
For loop structure
for(initial value; condition; increment/decrement { statements to be repeated if true }
Intial value in for loops
Sets at what number should the repeat process start
Condition in for loops
Repeat should occur only when this condition is true
Increment/decrement
Move the counter forward or backward
Prepares the environment for developing java applications
Java Netbeans IDE Function
Integrated Development Environment
IDE Full form
Platform to write Java code and applications (Version 7 ngayon)
Java Netbeans
Desktop applications, client-server applications, mobile phone applications, games
What does java develop?
Platform independent
Java major advantage
Java Virtual Machine (JVM)
Java’s own runtime environment
Sun Microsystems
Current owner of java
Java Virtual Machine (JVM) and Java Development Kit (JDK)
What to download?
Source code wiith .java extension
Java code to write & extension
Another program called Javac that turns it into a Java byte code with .class extension (there should be no present errors)
What compiled the source code?
Class file
File that Java Virtual Machine runs
Grayed out areas with forward slashes (// for single line comments; /* */ for multiline comments and asterisks that the compiler ignores
Java Comments
Starts with /** ends with */ to document the code (converted to HTML)
Javadoc comments
True
Java is case sensitive
Semicolon (;)
Java code instructions end with a
Class segment notes the starting and ending of a java class segment code
public class MyFirstProgram { }
Method
Public static void main(String[] args){ }
the code can be accessed outside the class without creating new objects
Public in “public static void main(String[] args){
This part of the code does not return any value
Void in “public static void main(String[] args){
Denotes starting point of the java program
Main in “public static void main(String[] args){
NetBeans tries to display a list of available options after “.”
IntelliSense
Cleans and builds your project with all necessary files for export if the program needs to be shared; will be put in a dist folder
.Jar file (java archive) function
can be text, numbers, pointers, objects or some specified memory location
Data
How is data accessed
Joining together direct text and a variable
Concatenation
True
You cannot start with a number for a variable name
True
You cannot have the same variable name with a keyword
False
Variable names can have a space
False
Variable names are not case sensitive
+-2147483647 (use double to get a bigger/smaller number)
Java minimum and maximum value for numbers
Order in which arithmetic’s operations are executed
Operator Precedence
Multiplication & Division > addition and subtraction
Priority in operators
String variable
Double quotes
char variable
Single quotes
Tells java you want to use the scanner class in the util package of java library
Import java.util.Scanner; function
Class that handles inputs
Scanner in Import java.util.Scanner;
utility package of the java library where scanner is stored
Util in Import java.util.Scanner;
Scanner user_input = new Scanner (System.in);
Scanner variable
Creates the new objects
New in Scanner user_input = new Scanner (System.in);
Specifies for system input
System.in in Scanner user_input = new Scanner (System.in);
TThe variable that is called to call the input methods
User_input in Scanner user_input = new Scanner (System.in);