String myText = "I am a text";
String Length - .length()
toUpperCase() and toLowerCase()
txt.indexOf("locate")) | .substring()
String Concatenation +, firstName.concat(lastName)
Java Special Characters \, n, r, t, b,...
.equals() | .charAt() | replace () |.compareTo()
compareToIgnoreCase(String)
import.util.Scanner;
myobj.close();
Math.max(5, 10); // result 10
Math.min(7,2); // result 2
Math.sqrt(64); // result = 8
Math.pow(2, 4); // result = 16
Math.abs(-4.7); // reult = 4.7
Math.random(); // 0.0 to 1.0
int randomNum = (int)(Math.random() * 101); // 0 to 100
(Math.round(0.60)); // result = 1;
Input in JAVA ➡ import java.util.Scanner;
Output in JAVA ➡ system.out.println();
Input in JAVA ➡ IBIO.inputString("Enter your name: ");
Output in JAVA ➡ BIO.output(userInput);
Building a Java Counter with JFrame in NetBeans.
Button
Label
setText(Integer.toString(myCount));
Building a Java User Interface with JFrame in NetBeans.
Button
Label
...equals();
JFrame Popup
JOptionPane.showMessageDialog(null, "Message", "Title", JOptionPane.WARNING_MESSAGE);
JOptionPane.showConfirmDialog(null, "Would you like to delete the record?","Delete Confiration!", JOptionPane.YES_NO_OPTION);
Documentation |Link|
Building a Java Number generator with JFrame in NetBeans.
Button - Label - Java Array
btnAverage.setEnabled(true); // Enable the "Average" button
Integer.parseInt(); // Convert text to int
String.valueOf(), // Convert int to String
String[] myArray = new String[5]; // Declare a String array with 5 empty slots
...getText();
...setText();
Java Core Topics
Variables: primitive variable types, text strings, and constants
Data input from the keyboard with the Scanner and IBIO classes
Operators: arithmetic, relational, and logical
Control flow: conditional statements
Control flow: loops
Functions: input and output values, formal and actual parameters
Java objects: methods of the Math, Random numbers
Java objects: methods of String, and StringBuffer classes
Pseudocode methods for collections
Functions: call by value and call by reference
Reading from and writing into text files
Java OOP Topics
Java objects: introduction to Object-Oriented Programming
Variables: instance variables and static variables
Java objects: 1D and 2D arrays
Java programs with command line parameters
Java objects: the ArrayList and the LinkedList classes
Object-Oriented Programming: Encapsulation
Object-Oriented Programming: Inheritance
Object-Oriented Programming: Polymorphism
Method overloading (compile time polymorphism)
Method overriding (run time polymorphism)
The relationships between Java classes, and their UML diagrams