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
Colt1911 [192]
3 years ago
10

. Constructors are executed when?

Computers and Technology
1 answer:
adoni [48]3 years ago
6 0

Answer:

 The constructor are executed when the constructor object are comes in the existence as per the general rule in the computer programming language. The constructor is the special type of the class function that basically perform the initialization of the each object in the computer science.

Then, the constructor initialized actual value of the member of an object are allocated to the given object in the system.  

You might be interested in
What is the difference between being an affiliate and an independent station ?what are the benefits to being an affiliate
katen-ka-za [31]

Answer:

So the difference is one does its own thing the other is someone who is working with another.The benifits are that if it is something good done you both get the reward the bad part is that if its bad then you both get in trouble for it.

Explanation:I hope this helps

6 0
3 years ago
45, 78, 23, 12, 63, 90, 38, 56, 88, 15 Using the sequential search as described in this chapter, how many comparisons are requir
Alecsey [184]

Explanation:

By using the sequential search we find the following results.

  • The first key is 90 and its comparison number is 6.
  • The second key is 14 and its comparison number is 10.
  • The third key is 45 and its comparison number is 1.
  • The fourth key is 23 and its comparison number is 3.
  • The fifth key is 5 and its comparison number is 10.
8 0
3 years ago
Use the nutrition label to determine how many calories would be consumed by drinking 1 liter of Mountain Dew.
Rus_ich [418]
1 liter of mountain dew is 170 calories
4 0
3 years ago
Read 2 more answers
Write a program that reads the lengths of the sides of a triangle from the user. Compute the area of the triangle using Heron's
slamgirl [31]

Answer:

The java program is as follows.

import java.util.Scanner;

import java.lang.*;

public class Area

{

   //variables to hold the values

   static double a, b, c;

   static double s;

   static double area;

public static void main(String[] args) {

    //scanner class object created

    Scanner sc = new Scanner(System.in);

 System.out.print("Enter the first side: ");

 a=sc.nextInt();

 System.out.print("Enter the second side: ");

 b=sc.nextInt();

 System.out.print("Enter the third side: ");

 c=sc.nextInt();

 s=(a+b+c)/2;

 //function of Math class used

 area = Math.sqrt( s*(s-a)*(s-b)*(s-c) );

 //result displayed with 3 decimal places

 System.out.printf("The area of the triangle is %.3f", area);  

}

}

OUTPUT

Enter the first side: 1

Enter the second side: 1

Enter the third side: 1

The area of the triangle is 0.433

Explanation:

1. The variables to declare the three sides of the triangle, the semi-perimeter and the area of the triangle are declared with double datatype. All the variables are declared at class level and hence, declared with keyword, static.  

2. Inside main(), an object of the Scanner class is created.

Scanner sc = new Scanner(System.in);

3. Using the Scanner class object, user input is taken for all the three sides of the triangle.

4. Following this, the semi-perimeter is computed as shown.

s=(a+b+c)/2;

5. The area of the triangle is computed using the given formula which is implemented as shown.

area = Math.sqrt( s*(s-a)*(s-b)*(s-c) );

6. The sqrt() method of the Math class is used while computing the area of the triangle.

7. The area is displayed with three decimals. This is done using the printf() method as shown.

System.out.printf("The area of the triangle is %.3f", area);

8. The program is saved with the same name as the name of the class having the main() method.

9. The class having the main() method is always public.

3 0
3 years ago
Write a program that could find whether the number entered through keyboard is odd or even the program should keep on taking the
natulia [17]

Answer:

using namespace std;

int main() {

int number;

while (1) {

 cout << "Enter a number: ";

 cin >> number;

 cout << number << " is " << ((number % 2) ? "odd" : "even") << endl;

};

return 0;

}

Explanation:

This is a c++ version. Let me know if you need other languages.

The (number % 2) is the essence of the program. It returns 0 for even numbers, and 1 for odd numbers (the remainder after division by 2).

7 0
4 years ago
Other questions:
  • The command prompt found on windows 10 is very similar to the interface of what past operating system?
    5·2 answers
  • Which of the following is an advantage to using plain text format? Check all of the boxes that apply.
    15·2 answers
  • ammy's Seashore Supplies rents beach equipment such as kayaks, canoes, beach chairs, and umbrellas to tourists. Write a program
    13·1 answer
  • In a period of steep increases in interest rates, which issuer is most likely to be negatively affected? A Trucking company B Ut
    9·2 answers
  • How does the actual amount left to spend differ from the budgeted amount for the remaining three months of the project?
    12·1 answer
  • Is a tv a
    6·1 answer
  • Match the image to the view type in a presentation program. scroll bar tool bar status bar menu bar provides an array of buttons
    10·2 answers
  • I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRIST AND CORRECT
    10·2 answers
  • What are a few ways to format the text in a mail message in Outlook? Check all that apply.
    7·2 answers
  • A major retailer wants to enhance their customer experience and reduce losses
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!