Do you remember the first time you wrote some java code and were stuck on a really silly thing for hours? Well this puzzle is right up that alley,
package com.twister; public class Area { int length = 10; int area = length*breath; int breath = 20; public static void main(String[] args) { Area a = new Area(); System.out.println(a.area); } }
Apart for being a really silly piece of code with all values ‘hard coded’ – as you might have already guessed this code fails to compile.
The puzzle - what is the minimum code addition (no deletes, no moving the code – plain addition only) that is needed to make this code compile and run to give the expected output – 200?
Got an answer? Do leave it here.