com.example.mistakes.expression._11_IgnoredReturnValue.Ex2

🚀 com.example.mistakes.expression._11_IgnoredReturnValue.Ex2

Question fetched from API endpoint api/expression/11/2

API Response

GET /api/expression/11/2
{
  "result": [
    {
      "message": "com.example.mistakes.expression._11_IgnoredReturnValue.Ex2",
      "before": "    BigInteger before() {\n      var value = BigInteger.TWO;\n      value.add(BigInteger.ONE);\n      return value;\n    }\n",
      "after": "    BigInteger after() {\n      var value = BigInteger.TWO;\n      return value.add(BigInteger.ONE);\n    }\n",
      "chapter": 2,
      "id": "2_11_2",
      "className": "Ex2",
      "path": "file:///home/runner/work/100_java_mistakes/100_java_mistakes/back/src/main/java/com/example/mistakes/expression/_11_IgnoredReturnValue.java"
    }
  ],
  "length": 1
}

before

before
BigInteger before() {
  var value = BigInteger.TWO;
  value.add(BigInteger.ONE);
  return value;
}

after

after
BigInteger after() {
  var value = BigInteger.TWO;
  return value.add(BigInteger.ONE);
}