Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

"times 2" in Java?

Name: Anonymous 2009-04-11 18:16

import static java.lang.System.out;
public class Times2 {
  public static void main(final String[] args) {
    for (byte i = 1; i < 11; i++) {
      out.println(2 + " x " + i + " = " + 2 * i);
    }
  }
}


public class Times2 {
  public static void main(final String[] args) {
    for (byte i = 1; i < 11; i++) {
      System.out.println(2 + " x " + i + " = " + 2 * i);
    }
  }
}


Am I ENTERPRISE enough?

Name: Anonymous 2009-04-13 9:58

>>14
Doesn't look very scalable to me. You should create an Operator class so that it is possible to separate the external presentation of an operator from its semantics, and then possibly an OperatorFactory to ease Operator creation.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List