1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
valentina_108 [34]
3 years ago
8

The main purpose of a constructor is to initialize the data members at the moment that an object is created. true or false?

Computers and Technology
1 answer:
GalinKa [24]3 years ago
4 0

Answer:

True

Explanation:

In Object Oriented Programming, a constructor is a type of subroutine whose purpose is to create an object.

when the constructor is called, it initializes the data members of the object and establishes the invariant of the class.

Some important concepts:

Data members: The data members are the data encapsulated within the object (e.g. int hour for the variable <em>'hour'</em> in an object called <em>'date'</em>)

Invariant of the class: The class invariant is the invariant used to constrain the object (e.g. values between 0 and 24 for the variable <em>'hour'</em>)

You might be interested in
Unlike memory, this type of storage holds data and programs even after electrical power to the computer system has been turned o
Scrat [10]

Answer:

Secondary memory.

Explanation:

Unlike main memory which loses its content when electrical power to the system is turned off, secondary memory is volatile and persistent in nature. i.e it retains its content whether or not power is supplied to the computer that is holding it. As a matter of fact, they (secondary memory) are meant to store data permanently. Examples of such memory are the hard drives, floppy disks, flash drives, CDs and CDROMs.

Also, unlike the primary or main memory that can be accessed directly by the processor of the computer housing it, secondary memory are not accessed directly.

8 0
2 years ago
Within the try clause of a try statement, you code a. all the statements of the program b. a block of statements that might caus
SVETLANKA909090 [29]

Answer:

B) A block of statement that might cause an exception.

Explanation:

Exception handling is a good programming technique that prevents our program from crashing when an exception occurs during execution. The try clause is used with a catch to handle any exception that might occur, so whenever a statement that might cause an exception is to be used, this should be contained in a try statement block of code.

5 0
3 years ago
Write the function greeting that takes a string as input. That string will be formatted as Name Age Hobby, without any punctuati
Dmitriy789 [7]

Answer:

The function in Python is as follows:

def greetings(details):

   details = details.split(' ')

   print('Hello, '+details[0]+'!, I also enjoy '+details[2])

Explanation:

This defines the function

def greetings(details):

This splits the input string by space

   details = details.split(' ')

This prints the required output

   print('Hello, '+details[0]+'!, I also enjoy '+details[2])

After splitting, the string at index 0 represents the name while the string at index 2 represents the hobby

4 0
2 years ago
How is a website most likely to distinguish its different sections?
Jlenok [28]

Answer:

D. by using different background colors for different sections​

Explanation:

This can help people differentiate the different sections of your webpage.

Hope this helps!

4 0
3 years ago
Fill in the blank - A generation of social-oriented, physical games such as the _______ Wii console, emerged in the late 2000s,
disa [49]

Answer:

wild bro just need points

Explanation:

6 0
3 years ago
Other questions:
  • Using a loop, write a program that reads in exactly five integers and outputs the sum.
    11·1 answer
  • Question 4 (2 points)
    6·2 answers
  • A modern information-processing model that views memories as emerging from particular activation patterns within neural networks
    6·1 answer
  • The __________ vulnerability assessment is a process designed to find and document selected vulnerabilities that are likely to b
    15·1 answer
  • Media messages are communicated through which of the following:
    8·2 answers
  • Henry conducted a survey on an ad done by his company. In the survey, he asked people to evaluate the ad and state whether they
    8·1 answer
  • A(n) _______ gate provides an output of 1 if either or both inputs are 1.
    14·2 answers
  • HELP PLZZZZZZZZ!!!!!!!!!!!
    14·1 answer
  • Data security issues that must be addressed by hipaa implementation teams include:__________
    9·1 answer
  • which two partitions do you typically create at minimum during a fedora linux installation? (choose two answers.)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!