Computer Science, asked by Sahilpanjla4244, 1 year ago

Why the given declarations are invalid in java? discuss. which modifier is applicable for a local variable? why? class test{ public static void main(string[] args) { static int a; public int a; private int a; protected int a; } }?

Answers

Answered by Kohli185
3
protected is invalid because we can't modify it's value. public is applicable for a local variable because it can be called or we can modify it's value during execution
Similar questions