public class ClassA { private int a; private char x; public ClassA () { a=5; x='c'; int local; } } |
Solution | |
In the exaple a local variable 'local' has been delcared. This should be avoided. Constructor should only be used to assign value to the fields
|