- BASICS
-
Classes
- Objects
- Arrays
- Variables
- Loops
- Numbers
- Strings
- Exceptions
- Regexp
- OOP
- Inheritance
- Polymorphism
- Static Keyword
- Abstract Keyword
- Interfaces
- Constructors
- Packages
- Nested Classes
- Final Keyword
- SWING
- Frame
- Panel
- Listener
- Combo Box
- Label
- Image
- Menu
- Table
- Layout
- Drawing
- Timer
- Designer
- COLLECTIONS
- Lists
- Comparable
- Sets
- Maps
- Generics
- Properties
- Streams
- Json
- COMPILER
- Sublime Text
- Apache Ant
- I/O
- Streams IO
- Socket
- Watching Files
- Logger
- Clipboard
- Encrypt
- JAVAFX
- Openjfx
- Scene Builder
- First App
- Jar Archive
- On Action
- Change Listener
Hello World
/**
* In Java, everything goes into a class (.java file)
* JVM compiles the file, a .class file is created
*
* The program starts in main()
* The return type void means there is no returned value
* Every statement must end in semicolon
*/
package com.minte9.basics.classes;
public class Classes {
public static void main( String[] args ) {
System.out.println("Hello World!"); // Hello World!
}
}
Blueprint
/**
* A class is a blueprint for an object
*
* Instance variables (fields) is what an object knows
* Methods is what an object does
*/
package com.minte9.basics.classes;
public class Blueprint {
public static void main(String[] args) {
MyClass obj = new MyClass();
obj.setName("John");
System.out.println("Hello " + obj.name); // Hello John
}
}
class MyClass {
public String name;
public void setName(String name) {
this.name = name;
}
}
Last update: 219 days ago