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
Taya2010 [7]
3 years ago
14

Which of the following statements is true?

Computers and Technology
1 answer:
jeka57 [31]3 years ago
7 0

Answer: Constructors can specify parameters but not return types.

Explanation:

public class Student {

 int roll_no;

 public Student(int a) {

   roll_no = a;

 }

public static void main(String[] args) {

   Student abs = new Student(10);

   System.out.println(abc.roll_no);

 }

}

In the above code we have illustrated the working of constructors. We have a class with the name Student. then a constructor is created of the class called as the class constructor. In the main we create an object of the class and with this object we invoke the constructor and also pass a parameter. Here in the code we are passing the roll no of the student.

So we can say that constructor is called during the runtime when the object created invokes the constructor so a constructor can have many arguments but it does not have a return type.

You might be interested in
JAVA
Virty [35]

Answer:

Is in the provided screenshot

Explanation:

Get the last two characters and concatenate.

6 0
3 years ago
What's wrong with my program? Here is my code , if the user wants a 3rd card dealt they, have to select yes and the total will b
Mashcka [7]

Your issue is on line 19 in your if statement. In python, if you have more than one condition in an if statement, you have to explicitly mention it after the or.

Your if statement is

if again == "Y" or "y":

However, this will always return true because the second statement simply asks "y".

To correct this, simply change the if statement to:

if again == "Y" or again == "y":

This will correct your code.

Another thing to consider is to always convert a userinput (whenever possible) to one version, this can be accomplished in your code by converting "again" into one version by using the .lower function.

again = input("Would you like to draw a 3rd card? Y or N? ")

again = again.lower()

Hope this helps!

4 0
2 years ago
Just letting all my friends know, i am deleting this account and making a new one same username and profile picture so you know
ki77a [65]

Answer:

Explanation:

OK good luck

3 0
3 years ago
Read 2 more answers
The specific gravity of gold is 19.3. Write a MATLAB program that will ask the user to input the mass of a cube of solid gold in
s344n2d4d5 [400]

Answer:

Check the explanation

Explanation:

<em>Cube.m:</em>

mass = input("Enter the mass of cube [kilograms]: ");

if(mass<=0)

disp("Error: Mass must be greater than zero grams")

else

fprintf("The length of one side of cube is %.2f inches",2.7*mass);

end

<em>Output1</em>

octave:2> source ( Cube.m Enter the mass of cube [kilograms]: octave:2>-3 Error: Mass must be greater than zero grams

<em />

7 0
4 years ago
Each row in a database is a set of unique information called a(n)
blondinia [14]

A row, which is also called a tuple.

4 0
3 years ago
Read 2 more answers
Other questions:
  • based on the transcript, what did broadcasting the story through the medium of radio allow welles to do?
    8·1 answer
  • You want to print only the fourth page of your research document. What would you do?
    9·2 answers
  • Darian has a gourmet cupcake business and needs a website to compete with the other bakeries in his area. He has a Google My Bus
    15·1 answer
  • What is network management?
    12·1 answer
  • Charlie makes pizza at a restaurant. The customers always compliment how great the pizza tastes. But Charlie takes a long time t
    7·2 answers
  • Compute the acceleration of gravity for a given distance from the earth's center, distCenter, assigning the result to accelGravi
    12·1 answer
  • Which statement describes the Direction option for animations and transitions?
    5·2 answers
  • A form of encryption that uses only one key to encrypt and decrypt a file. This is a less
    14·1 answer
  • Which device do engineers use to drive a system of gears?
    15·2 answers
  • Why do we create user accounts to customize our preferences​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!