Sunday, November 8, 2009

Puzzle 58 – Simple Upgrade.

Language – Java | Type – Concept | Last date 15-Nov-2009 12:00 p.m. IST | Points 3

Here is the puzzle straight and simple. A piece of code was written which had a read() method with the signature below. Thing change and instead of using integers – it was now required to use Floats instead of Integers.

To cut a long story short what is the minimum change considering additions/deletions (each char added or deleted count as 1) to get the code below to compile. (I think it can be done in less than 10 characters)

package com.twister;

import java.util.ArrayList;
import java.util.List;

public class Gener {
public void read(List<Integer> x){}

public static void main(String[] args) {
new Gener().read(new ArrayList<Float>());

Got an answer? Leave one here

1 comment:

  1. Just replace 'Integer' with '?'
    7 symbols deleted, 1 added

    P.S. I'm getting this when trying to post code here:
    Your HTML cannot be accepted: PHP, ASP, and other server-side scripting is not allowed.


Solution for this question?