Friday, May 30, 2008

名も無き戦士になる為に

名も無き戦士になる為に
幼き少年は━
步みを止めはしなかった
Namonaki senshi ni naru tame ni
Osanaki shounen wa -
Ayumi wo tome wa shi nakatta
To become a nameless warrior
This young boy -
never stopped walking onward



Just a summary of what Java has been taught in this week's PRSP lectures and tutorial.

Input

Methods available in the Scanner class for input are:
nextInt()Read in an integer
nextDouble()Read in a double
nextBoolean()Read in a boolean
next()Read in a word
nextLine() Read in a whole line

You need to create a Scanner object first before using the methods here.

Example



Operators
  • An operator performs a specified operation on its operands and returns a value.
  • The operands can be a variable, a literal, or an expression.
  • Java Operators can be divided into these categories: arithmetic, relational, conditional, bitwise, logical and assignment.
  • Operators that require one operand are known as Unary Operators and Operators that require two operands are known as Binary Operators.
  • Binary Operators
    OperatorUseDescription
    +op1 + op2Gives the sum of op1 and op2
    -op1 - op2Subtracts op2 from op1
    *op1 * op2Gives the multiplication of op1 and op2
    /op1 / op2Divides op1 by op2
    %op1 % op2Gives the remainder when op1 divides by op2
  • Division in Java
    int / intgives int (all decimals lost; truncated)
    int / doublegives double (accurate)
    double / intgives double (accurate)
    double / doublegives double (accurate)
  • Unary Operators
    OperatorUseDescription
    ++op++Increases the value of op by 1
    --op--Decreases the value of op by 1
  • Assignment Operator
    • An assignment statement is a statement to assign a value to a variable.
    • The value of a variable may be changed by the following form of statements
      • Variable = Expression;
      • The variable Variable is assigned the value of the Expression.
    • The symbol = is called assignment operator.
    • Example:
      • int year = 1;
      • double amount = 550.0 + 25.50;
    • The assignment always proceeds from right to left. That is, the value of the operand on the right is stored into the variable on the left.
    • Note: the left hand side must be a variable name and not a constant or expression with operators.
  • Special Assignment Operators
    OperatorUseDescription
    +=op1 += op2op1 = op1 + op2
    -=op1 -= op2op1 = op1 - op2
    *=op1 *= op2op1 = op1 * op2
    /=op1 /= op2op1 = op1 / op2
    %=op1 %= op2op1 = op1 % op2



Lol, Naruto chapter 402 is quite good. Looks like Sasuke has got his Eternal Mangekyou Sharingan [getting his Mangekyou Sharingan from the death of someone close to him (Orochimaru), and then getting his Eternal Mangekyou Sharingan from the death of his brother (Itachi), at the same time, lol), and he is going to crush Konoha, which is exactly opposite of what his brother Itachi wants.

Sigh... No choice, Sasuke has gone too emo. So, he renames his team from "Snake" to "Eagle", and oh, guess what? There we see Madara hanging out with Sasuke and his newly-named Team Eagle. What, Madara, intending to join Eagle as well, huh? Oh well. Have fun, the five of you. At least Sasuke's new Eternal Mangekyou Sharingan looks beautiful. XD



Bleach chapter -100 confused the hell out of me. Just when will this darn flashback end?? D:

No comments: