Is there ever a reason to have a public attribute in a


1. Is there ever a reason to have a public attribute in a class?

2. What does it mean for a method to be overloaded?

3. Is it true or false that every class should have a toString( ) method that returns a String which is a text representation of the object. The method is not sent any actual. Is the toString( ) method overridden?

4.What is the value of s2:

String s1 = new String( "2 late 2 drop" );

String s2 = s1.substring( 3, 6 );

5. Is it true or false that the toUpperCase( ) method of the String class is a mutator?

6. When should an attribute of a class be static?

7. Is it true or false that if a method within a class is static, then the method can be called without an instance of the class?

8. What two access specifier keywords can be used to encapsulate attributes and behaviors within a class?

9. Is it true or false that inheritance creates an "is-a" relationship between classes?

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Is there ever a reason to have a public attribute in a
Reference No:- TGS01249143

Now Priced at $20 (50% Discount)

Recommended (91%)

Rated (4.3/5)