12. Software reuse and the standard Java API Flashcards

1
Q

What three (ranges of) values are returned by a compareTo method, and what does each mean?

A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What tags do we use to specify a method interface?

A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the maximum number of the 12 following methods that we could legally have in the same class?

public Cooks burn(char coal, int oven) { }
private Cooks burn(char grilled, int fire) { }
public static Cooks burn(char mingly, int ime) { }
public static Cooks burn(char treuse, int glass) { }

public static void burn(char treuse, int glass) { }
private static void burn(char mingly, int ime) { }
public void burn(char grilled, int fire) { }
private void burn(char coal, int oven) { }

public double burn(char coal, int gasBbq) { }
public static double burn(char coal, int fixedGasBbq) { }
private double burn(char coal, int secretHotSpot) { }
private static double burn(char jes, int rest) { }

A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Is String a built-in type or a reference type? Is it a primitive type?

A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name six String instance methods (two may have the same name!).

A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the value of each of the following conditions?

  1. ‘A’ < ‘B’
  2. ‘A’ < ‘a’
  3. ‘Z’ < ‘a’
  4. ‘0’ < ‘1’
  5. ‘0’ < ‘A’
  6. ‘0’ < ‘a’
A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the value of the following expression?

"" + (char) ((int) 'J' - 2
    \+ (char) ((int) 'c' + 2
    \+ (char) ((int) 'n' - 2
    \+ (char) ((int) 'j' + 2
    \+ (char) ((int) 'q' - 2
A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly