File tree Expand file tree Collapse file tree 5 files changed +81
-0
lines changed
Expand file tree Collapse file tree 5 files changed +81
-0
lines changed Original file line number Diff line number Diff line change 1+ import java .util .LinkedList ;
2+ import java .util .Queue ;
3+
4+ public class BBQ {
5+
6+ public static void main (String [] args ) {
7+
8+ Queue <String > q = new LinkedList <String >();
9+
10+ q .add ("A" );
11+ q .add ("B" );
12+ q .add ("C" );
13+
14+ System .out .println (q .poll ());
15+
16+ }
17+
18+ }
Original file line number Diff line number Diff line change 1+ import java .util .Stack ;
2+
3+ public class StacksRFun {
4+
5+ public static void main (String [] args ) {
6+
7+ // Y
8+ // B
9+ // R
10+
11+ Stack <Character > tower = new Stack <Character >();
12+
13+ tower .add ('R' );
14+ tower .add ('B' );
15+ tower .add ('Y' );
16+
17+ System .out .println (tower .size ());
18+
19+ }
20+
21+ }
Original file line number Diff line number Diff line change 1+
2+ public class StringInteger {
3+
4+ public static void main (String [] args ) {
5+
6+ String s = "age: 47" ;
7+ s = s .replaceAll ("\\ D+" ,"" );
8+
9+ int n = Integer .parseInt (s );
10+
11+ System .out .println (n + 2 );
12+
13+ }
14+
15+ }
Original file line number Diff line number Diff line change 1+ import java .util .Scanner ;
2+
3+ public class ReactFAST {
4+
5+ public static void main (String [] args ) throws InterruptedException {
6+
7+ System .out .println ("3" );
8+ Thread .sleep (1000 );
9+ System .out .println ("2" );
10+ Thread .sleep (1000 );
11+ System .out .println ("1" );
12+ Thread .sleep (1000 );
13+
14+ System .out .println ("GO!!!!!!!!!" );
15+ long startTime = System .currentTimeMillis ();
16+
17+ Scanner s = new Scanner (System .in );
18+ s .next ();
19+ long stopTime = System .currentTimeMillis ();
20+
21+ long reactionTime = stopTime - startTime ;
22+
23+ System .out .println (reactionTime + "ms" );
24+
25+ }
26+
27+ }
You can’t perform that action at this time.
0 commit comments