How many different variable names are there in JAVA? Combinatorics Question

233 Views Asked by At

The name of a variable in the JAVA programming language is a string of $1$ to $65,535$ characters, where each character can be an uppercase or a lowercase letter, a dollar sign, an underscore, or a digit. Furthermore, the first character in the string must not be a digit. How many different variable names are there in JAVA?

Hint Given:

I know there are the following characters:

  • $26$ Lowercase Letters
  • $26$ Uppercase Letters
  • $1$ Dollar Sign ($) - $1$ Underscore(_)

For a total of $54$ ways.

I am unsure where to go from this point. If this could be worked out with an explanation it would be much appreciated.

1

There are 1 best solutions below

2
On BEST ANSWER

Hint: Do you recognize the exponent on $r$ as the number of characters after the first? How many one character names are there? What does that represent?