86.8k views
4 votes
Which of the following statements is false? Question 4 options: By convention class names begin with an uppercase letter, and method and variable names begin with a lowercase letter. Instance variables exist before methods are called on an object, while the methods are executing and after the methods complete execution. A class normally contains one or more methods that manipulate the instance variables that belong to particular objects of the class. Instance variables can be declared anywhere inside a class.

User Kazenorin
by
6.8k points

2 Answers

3 votes

Answer:

Instance variables can be declared anywhere inside a class.

Step-by-step explanation:

The structure of writting object oriented programs allows execution to be carried out sequentially (Top-Down). As such for an instance variable to be utilized in a program it has to have appeared earlier in the code. An instance variable that has not been created (Declared) cannot be available for usage by the methods of the class for this reason the instance variables' declaration appears first within a class definition.

User PedroZorus
by
6.7k points
5 votes

Answer:

Instance variables can be declared anywhere inside a class.

Although there isn't any rule to declare instance variables before methods, and they can be declared anywhere in the class, they cannot be declared inside method definitions of class.

///////////////////////////////////////////////////////////////////////////////////////////////////////////

By convention class names begin with an uppercase letter, and method and variable names begin with a lowercase letter. - True.

Instance variables exist before methods are called on an object, while the methods are executing and after the methods complete execution. - True.

A class normally contains one or more methods that manipulate the instance variables that belong to particular objects of the class. - True

User Jesper Bylund
by
7.0k points