Saturday 1 February 2014

8 primitive data types

drag and drop

a = Shapes.AddEllipse(100,100)
b = Shapes.AddRectangle(100,100)
GraphicsWindow.MouseMove = mousemove

Sub mousemove
  If GraphicsWindow.MouseX >= Shapes.GetLeft(b) then
    If GraphicsWindow.MouseX <= Shapes.GetLeft(b) + 100 then
      If GraphicsWindow.MouseY >= Shapes.GetTop(b) Then
        If GraphicsWindow.MouseY <= Shapes.GetTop(b) + 100 then
  While Mouse.IsLeftButtonDown
    Shapes.move(b, GraphicsWindow.MouseX - 50, GraphicsWindow.MouseY - 50)
  Endwhile
EndIf
EndIf
EndIf
endif
endsub
1. Chapter1 - Installation and setup
Java development kit = compiler, virtual machine, and codes
package = nothing but folder

Chapter2 Notes
comment
- multiline: /*
- single line: //

printing a text
System.out.println("aloha");

concantenator = +
examples:
x = 10
System.out.println("aloha" + x);

mod: %
example: 5 % 2

IF
int x = 20;
int y = 20;
if (x < y){
    System.out.println("x is less then y");
}
if (x == y){
    System.out.println("x is equal to Y");
}
if (x > y){
    System.out.println("x is bigger then y");
}

shorten that if

int x = 20;
int y = 20;
if (x < y) {
    System.out.println("x is less then y");
}
else if (x == y)
shorten again:

Symbol:
x ++ itu sama dengan x = x+1 sama dengan x+=1

Switch-case
Contoh: pemilihan menu nasi goreng berdasarkan jenis hari.
nasigoreng = hari

Java

If, if-else
for, while, do-while, for-each
arrays
string manipulation, wrapper classes
data types and operators

Chapter3
Class, object
data and methods
method signature
this keyword
constructor

Chapter4
Object oriented-programming
What makes a language OOP?
encapsulation and data hiding
getter and setter
polymorphism, overloading


Chapter 5 review

Chapter6

Inheritance
abstract classes
interfaces
super keywor
overriding

Chapter7
Collections
List, arraylist
Hashmap
Generics

Chapter 8
Exceptions
try-catch-finally
throw and throws


Chapter9
Final, static
Final keyword
Static keyword
Variable arguments