Purchase Solution

Java Class and Attribute Mixed Questions

Not what you're looking for?

Ask Custom Question

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?

Purchase this Solution

Solution Summary

The solution briefly answered 9 simple questions about basic Java use, touching on strings, protected vs. private and more.

Solution Preview

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

answer: when a class has a constant attribute that can be accessed by anyone, then
you could make the constant attribute public.

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

answer: it is a way to use the same method name with a different method signature which is determined
by the number of the method parameters, the types of the parameters and the order of the ...

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.