Question

If a data that is to be defined for a class has the following characteristics: It...

If a data that is to be defined for a class has the following characteristics:

  • It exists without the need of an object instantiation
  • It can be accessible by all
  • It can't be modified

then the data must be declared as

A) private constant member data

B) public constant member data

C) private constant static data

D) public constant static data

0 0
Add a comment Improve this question Transcribed image text
Answer #1


C) private constant static data

Add a comment
Know the answer?
Add Answer to:
If a data that is to be defined for a class has the following characteristics: It...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. What is output by the following code: ArrayList< Integer > a = new ArrayList< Integer...

    1. What is output by the following code: ArrayList< Integer > a = new ArrayList< Integer >(); ArrayList b = a; a.add(new Integer(4)); b.add(new Integer(5)); a.add(new Integer(6)); a.add(new Integer(7)); System.out.println(b.size()); A)1 B)2 C)3 D)4 E)5 2. Assume the Student and Employee classes each extend the Person class. The Student class overrides the getMoney method in the Person class. Consider the following code:     Person p1, p2, p3;     int m1, m2, m3;     p1 = new Person();     m1 = p1.getMoney();     // assignment 1...

  • Context of my question: I am reading C#. Trying to understand Static keyword. I understand that...

    Context of my question: I am reading C#. Trying to understand Static keyword. I understand that when Static is applied to a member of a class, it can only be modified by the class and not the class object references. I will take an example here. public class BluePrint {    public static string BluePrintCreatorName; } If I need to know the BluePrintCreator's Name, I can call BluePrint.BluePrintCreatorName; But if a house that is created from the blueprint wants to...

  • 1) Which of the following is the name of a local variable in the Strange class...

    1) Which of the following is the name of a local variable in the Strange class below? public class Strange{ public static final int MAX = 5; public static void unknown(){ int number = 0; for (int i = MAX; i >= 1; i--) number += i * i; System.out.println(number); } public static void main(String[] a){ unknown(); } } a) Strange b) int c) MAX d) number e) main 2) Which of the following is NOT a method of the...

  • At face value this class seems ok ... but really it's not... select all that are...

    At face value this class seems ok ... but really it's not... select all that are true public class Student private Personal Info information; public Personal Info getInfo() return this.information; This is just a standard getter ... nothing wrong with that. Returning the Personalinfo reference can open this Student to direct manipulation of their data. A more robust public interface should be created to protect and control access to Personalinfo information. This is technically encapsulated properly, but could have very...

  • C++ Define the class HotelRoom. The class has the following private data members: the room number...

    C++ Define the class HotelRoom. The class has the following private data members: the room number (an integer) and daily rate (a double). Include a default constructor as well as a constructor with two parameters to initialize the room number and the room’s daily rate. The class should have get/set functions for all its private data members [3pts]. The constructors and the set functions must throw an invalid_argument exception if either one of the parameter values are negative. The exception...

  • Question 1) Consider a class Point that models a 2-D point with x and y coordinates. Define the c...

    C++ Question 1) Consider a class Point that models a 2-D point with x and y coordinates. Define the class point that should have the following Private data members x and y (of type int), with default values of 0 A constant ID of type int A private static integer data member named numOfPoints This data member should be o Incremented whenever a new point object is created. o Decremented whenever a point object is destructed. A default constructor An...

  • C++ Please I need answer ASAP i) Which of the following statements in a client program...

    C++ Please I need answer ASAP i) Which of the following statements in a client program correctly initializes a variable day/ of type DateType to 10/12/90? A. Initialize(10, 12, 90); B. day1.month- 10; day1.day-12; day1.year-90; C. day1.Initialize(10, 12, 90); D. cin>>month>>day>>year; E. The client program cannot initialize the date. ii) The members of a class are public by default. A) True B) False iv) The member variables and functions declared following the word_(1.) are accessible only to the class's member...

  • Which of the following statements is true about data members of a class definition? Data members...

    Which of the following statements is true about data members of a class definition? Data members are set in the constructor and cannot be changed later. Every object of the defined class has its own set of data members, with possibly different values. All data members are shared by all objects of the defined class. The value stored in a data member can be changed by any function in the program.

  • Part 1 of 1 Question 1 of 5 2Points Constant types defined under classes need to...

    Part 1 of 1 Question 1 of 5 2Points Constant types defined under classes need to be encapsulated. True False Reset Selection Question 2 of 5 2Points A user defined Java class usually is meant to be a template. True False Reset Selection Question 3 of 5 2Points Which of the following statements should be used to declare a variable under a Java class? O A. String name; OB. public int age; C. public static double PI; D. private char...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT