0

I saw a code in a project and there was a { } block inside of a method without any specifier etc.

Working code was something like this:

public void someMethod(params) {

    //some code1
    //some code1
    
    {
        //some code2
        //some code2
    }
    //some code3
    //some code3
}

As you see some code2 is in a separate block.

What is the reason for doing this? Is it making a functional difference or just a coding standard?

MC Emperor
  • 22,334
  • 15
  • 80
  • 130
abidinberkay
  • 1,857
  • 4
  • 36
  • 68

0 Answers0