Question: what is the difference between a local variable and a field (class variable/data)?
Answer: What is the difference between a field variable and a local variable? Field variables: Variable that are declared as a member of a class. OR Variables declared outside any method/constructor but inside the class block. ... Local variables: Variables that are declared within a method or a specific block of statements.