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
nydimaria [60]
3 years ago
7

Given the following class import java.util.ArrayList; public class RectangleTester { public static void main(String[ ] args) { A

rrayList shapes = new ArrayList(); shapes.add(new Rectangle(1, 1)); shapes.add(new Rectangle(2, 2)); shapes.add(new Rectangle(3, 3)); shapes.add(new Rectangle(4, 4)); Rectangle dataRecord; for(int index = 0; index < shapes.size(); index++) { dataRecord = shapes.get(index); dataRecord.calcRectArea(); dataRecord.calcRectPerimeter(); } } } Which of the following could not be a constructor for the RectangleClass? I. Rectangle(int s1, int s2) { mySide1 = s1; mySide2 = s2; } II. Rectangle(s1, s2) { mySide1 = s1; mySide2 = s2; } III. Rectangle() { }
Computers and Technology
1 answer:
horrorfan [7]3 years ago
8 0
We didn't need to see all that code to know that answer.


I. Rectangle(int s1, int s2) { }
is a valid constructor

I<span>I. Rectangle(s1, s2) { }
is an invalid constructor, as the data type for s1 and s2 was not specified.

</span>II<span>I. Rectangle() { }
is a valid constructor, as it is simply the default constructor.</span>
You might be interested in
What does xhtml stand for?
igomit [66]
Extensible Hypertext Markup Language.
3 0
3 years ago
Read 2 more answers
Which word most strongly appeals to pathos?
const2013 [10]

Answer:

I think it would be unfulfilled

6 0
3 years ago
Please help me answering this question
Vanyuwa [196]

Answer:

none of them

Explanation:

the resistor is connected to the + pole of the battery, no circuit shows that.

a 1kΩ resistor would be brown-black-red, not brown black black.

8 0
2 years ago
Which command let’s you increase or decrease the on-screen magnification of your document
JulijaS [17]
Ctrl - and ctrl +       i hope that is good for you                         
8 0
3 years ago
Write a program that takes a point (x,y) from theuser and find where does the point lies. The pointcan
agasfer [191]

Answer:

C++ Program .

#include<bits/stdc++.h>

using namespace std;

int main()

{

int x,y;//declaring two variables x and y.

string s;//declaring string s..

cout<<"enter x and y"<<endl;

cin>>x>>y;//taking input of x and y..

if(x>=0 &&y>=0) //condition for 1st quadrant..

cout<<"the point lies in 1st Quadrant"<<endl;

else if(x<=0 &&y>=0)//condition for 2nd quadrant..

cout<<"the point lies in 2nd Quadrant"<<endl;

else if(x>=0 &&y<=0)//condition for 3rd quadrant..

cout<<"the point lies in 3rd Quadrant"<<endl;

else //else it is in  4th quadrant..

cout<<"the point lies in 4th Quadrant"<<endl;

cout<<"enter n to terminate the program"<<endl;

while(cin>>s)//if the user has not entered n the program will not terminate..

{

   if(s=="n")

   {

       cout<<"the program is terminated"<<endl;

       exit(0);

   }

   cout<<"you have not entered n please enter n to terminate the program<<endl;

}

}

Explanation:

The above written program is for telling the point lies in which quadrant.I am first declaring two variables x and y.Then after that taking input of x and y after that checking in which quadrant the point lies.

Taking input of the string s declared earlier for program termination the program will keep running until the user enters n.

4 0
3 years ago
Other questions:
  • Tom only thinks about his own gain and does not care about the team objectives. What quality is he demonstrating? A. resourceful
    9·1 answer
  • ________________are programs that designed to help users to be more productive with their personal tasks
    11·2 answers
  • A domain name is used to: *
    15·1 answer
  • Think back on the Font Tester App. Can you think of an example of another app or feature of an app which would use a loop to con
    14·1 answer
  • An IT department receives a shipment of 20 new computers, and Alice has been assigned the task of preparing them for deployment
    12·1 answer
  • To obtain your class E learner license, youll need too _
    9·1 answer
  • How many 60 KB jpeg files can be stored on a 2 MB folder in your hard drive?​
    7·1 answer
  • Which image file format is an uncompressed raster file which may contain different depths of color depths per pixel, or may be s
    5·1 answer
  • Connect research concepts to their definitions
    13·1 answer
  • The rectangular symbol in flowchart<br> is used to denote dash
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!