Compiler

I admit I was tricked:

 

import java.util.ArrayList;
public class ListProvider {
  public static <ArrayList> ArrayList getList(ArrayList ar) {
    return ar;
  }
  public static void main(String[] args) {
      getList("I am a list");
  }
}

This code compiles and runs of course.

shlomo 22/06/2009 - 21:53

A question I was asked by one of our customers quoted below:

-O

Directs the compiler to try to generate faster code by inlining static, final and private methods. This option may slow down compilation, make larger class files, and/or make it difficult to debug. -O implicitly turns on -depend and turns off -g.

This option informs the compiler that all generated class files are guaranteed to be delivered and upgraded as a unit, enabling optimizations that may otherwise break binary compatibility. Use this option with discretion.

hagzag 22/11/2008 - 21:38
Syndicate content