Howdy. 

In lecture please sit with your team. 

 +-->F->NO->PCD->OP->TM->S->C->F->I->S->P->B->Md--+ 
 |                                                |
 +--------------(Memento fixed location)----------+

Where are Mr. Yu's teammates (specifically Alex, Alex, Tim)?

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> 2 + 3
5
> 123456 + 65432l // 777777 
188888
> 2 == 2l
true
> 2
2
> 2l
2
> 2.1
2.1
> 2.1f
2.1
> double a = 2.0
> float b = 2.0
Static Error: Bad types in assignment: from double to float
> float b = 2.0f


Sunday Help Sessions started yesterday. 

They're on Sundays 2-4pm in LH102. 

I'll collect questions Wed-Sat and will post that Sat evening. 

Timer

How many Timers are there in the Java API? 

What package is your Timer in?

https://docs.oracle.com/javase/7/docs/api/java/util/Timer.html

https://docs.oracle.com/javase/7/docs/api/javax/swing/Timer.html

https://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html

import javax.swing.Timer; 
import java.awt.event.ActionListener; 

public class Monday {
  public static void main(String[] args) {
    ActionListener a = new Whatever();
    Timer t = new Timer(1000, a); // should a be this?     
    t.start(); 
  }
}

import java.awt.event.ActionListener; 
import java.awt.event.ActionEvent; 

class Whatever implements ActionListener {
  public void actionPerformed(ActionEvent e) {
    System.out.println("What?! ... " + e);  
  }
}

What about Matt's question? 

import javax.swing.Timer; 
import java.awt.event.ActionListener; 
import java.awt.event.ActionEvent; 

public class Monday implements ActionListener  {
  int count = 10; 
  public void actionPerformed(ActionEvent e) {
    System.out.println(count++);  
  }
  public static void main(String[] args) {
    Timer t = new Timer(1000, new Monday()); 
    t.start(); 
  }
}

Team exercise: 

  (a) assume BigBang and World

  (b) write Game that 

          moves Circle when keys Up, Down, Left, Right arrow are pressed
          Circle has location but no velocity, 
          key event moves it by 10 pixels in the right direction 

  If you need to define additional classes please sketch those too. 

--