Yes, local variable declarations you have done in the above code is allowed as long as you don't access them. If you happen to write any code that access those variables, the code will not compile.
According to Java Language Specification, you can't access local variables (the variables that you declare inside a method) unless they are initialized before accessing. Below is from Java Language Specification for SE 8.
https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.4.1
Chapter 16 - Definite Assignment
"For every access of a local variable or blank final field x, x must be definitely
assigned before the access, or a compile-time error occurs."
Chapter 14
14.4.2 Execution of Local Variable Declarations
A local variable declaration statement is an executable statement. Every time it is
executed, the declarators are processed in order from left to right. If a declarator
has an initializer, the initializer is evaluated and its value is assigned to the variable.
If a declarator does not have an initializer, then every reference to the variable must be
preceded by execution of an assignment to the variable, or a compile-time error occurs by
the rules of §16 (Definite Assignment).
Each initializer (except the first) is evaluated only if evaluation of the preceding
initializer completes normally.
Execution of the local variable declaration completes normally only if evaluation
of the last initializer completes normally.
If the local variable declaration contains no initializers, then executing it always
completes normally.