JAVA TRUE/FALSE. Write \'T\' if the statement is true and \'F\' if the statement
ID: 3735467 • Letter: J
Question
JAVA
TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false With a reason.
1) An object can store data.
2) A class in not an object, but a description of an object.
3) An access specifier indicates how the class may be accessed.
4) A method that stores a value in a class's field or in some other way changes the value of a field is known as a mutator method.
5) Instance methods should be declared static.
6) A constructor is a method that is automatically called when an object is created.
7) Shadowing is the term used to describe where the field name is hidden by the name of a local or parameter variable.
8) The public access specifier for a field indicates that the attribute may not be accessed by statements outside the class.
9) A method that gets a value from a class's field but does not change it is known as a mutator method.
10) Instance methods do not have the key word static in their headers.
11) The term "default constructor" is applied to the first constructor written by the author of a class.
12) When a local variable in an instance method has the same name as an instance field, the instance field hides the local variable.
13) The term "no-arg constructor" is applied to any constructor that does not accept arguments.
14) The java.lang package is automatically imported into all Java programs.
Explanation / Answer
1. TRUE, when an object is created it alloated memory to store data in its members;
2.TRUE, A class is not an object but a description of the object. A class acts as a blueprint for its objects because it tells the generalize format and behaviour of its members.
3.TRUE, As the name suggests access modifiers in Java helps to restrict the scope of a class, constructor , variable, method or data member.
4.TRUE, A mutator method is a method used to control changes to a variable.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.