0

This java method doesn't compile. It allows newName but not lastName. Can anyone explain why? Thanks!

void doStuff(String firstName, final String lastName)
{
    final String newName = "John";
    switch(firstName)
    {
    case newName:
    case lastName:
    }
}
Hovercraft Full Of Eels
  • 283,665
  • 25
  • 256
  • 373
Doug
  • 19

0 Answers0