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
USPshnik [31]
4 years ago
5

Analyze the following code. // Program 1: public class Test { public static void main(String[] args) { Object a1 = new A(); Obje

ct a2 = new A(); System.out.println(a1.equals(a2)); } } class A { int x; public boolean equals(Object a) { return this.x == ((A)a).x; } } // Program 2: public class Test { public static void main(String[] args) { Object a1 = new A(); Object a2 = new A(); System.out.println(a1.equals(a2)); } } class A { int x; public boolean equals(A a) { return this.x == a.x; } }
Computers and Technology
1 answer:
viktelen [127]4 years ago
8 0

Answer:

Hi there! The question is quizzing on your knowledge of type casting. Please find the explanation below.

Explanation:

The first program declares a Test class containing the main function in which two objects of class A are created and compared. The main function is the entry point of a Java program. After objects a1 and a2 are created, their comparison function “equals” is invoked and the result printed on the screen with the “System.out.println” method. The second program is the same in this respect, except for the implementation of class A. In the first program, class A has the property “x” defined as an int. The method “equals” accepts any object and type casts (converts) the passed object to a type of class A and compares and returns whether the property x of the type-casted object matches the property of the current object a. In the second program, the equals method of class A only accepts an input parameter of class A and returns whether the property x of the type-casted object matches the property of the current object a.

You might be interested in
Reesa works for a large real estate company. She is responsible for installing and supporting the company's internet systems, in
zalisa [80]

Answer:

System Administrator

Explanation:

A System Administrator is the individual who specifically handles the administrative functions of the IT department in an organization. The personnel is also responsible to administer, maintain, configure and upkeep the security of the computers.  

In the given situation, Reesa is provided with the job responsibility of installing and maintaining the internet system in the company. The job specifications that are entitled to Reesa is of the System Administrator.

8 0
3 years ago
The parental control service is experiencing technical difficulties.
DerKrebs [107]

The parental control service is experiencing technical difficulties when they can be overridden easily.

<h3>What is a Parental Control system?</h3>

Parental controls are known to be features or software that are said to be in a system that hinders one from been able to view some content online.

It is known to be a feature that helps parent to be able to look and restrict what their children can do online. When the block and filter that is used in websites and content can be easily overridden, then the parental control service may be experiencing technical difficulties.

Learn more about parental control from

brainly.com/question/6646156

4 0
3 years ago
Disadvantages of computer. ​
SVEN [57.7K]

Answer:You cant carry it around like a phone

Explanation:

7 0
3 years ago
Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in
Sladkaya [172]

Answer:

The program written in Java is given in the explanation section

Explanation:

public class num9 {

//Defining the method CountCharacters()

   public static int CountCharacters(char userChar, String userString){

       int c = userString.length();

       int count=0;

       for(int i=0; i<c; i++){

           if(userString.charAt(i)==userChar){

               count++;

           }

       }

       return count;

   }

//Main method begins here

   public static void main(String[] args) {

   char n ='n';

   String word = "Monday";

//Calling the method CountCharacters()

       System.out.println(CountCharacters(n,word));

   }

}

4 0
3 years ago
I NEED HELP!! THIS IS 3D COMPUTER MODELING COURSE IN CONNEXUS
Papessa [141]

6. x, y, and z (x is right, z is forward, and y is up)

7. true

8. plane

9. Cartesian grid

10. They describe a location using the angle and distance from the original.

11. effects that alter the look of an object.

12. true

13. true

14. (not sure, but I would go with conceptual)

15. 3-D elements

Hope this helps! Please let me know if you need more help, or if you think my answer is incorrect. Brainliest would be MUCH appreciated. Have a great day!

Stay Brainy!

8 0
2 years ago
Other questions:
  • Renee just got on the freeway to go to her cousin's house in Denver. She is driving 50 miles per hour. Her sister Kim left one h
    12·1 answer
  • A foreign country attempting to access government networks in order to disable a national power grid would be an example of: Sel
    7·2 answers
  • To employ an access key, press and hold down the ____ key as you tap the access key.
    14·1 answer
  • Commands are organized into tabs on the A. Ribbon. B. Quick Access toolbar. C. Status bar. D. ruler.
    13·2 answers
  • The Cursor is blinking in a white area on the Screen. This area where text will appear in the ____.
    10·2 answers
  • "3. 4. Simple number search We will pass you 2 inputs an list of numbers a number, N, to look for Your job is to loop through th
    5·1 answer
  • As a general rule, what is the size of a brochure?
    11·1 answer
  • Importance of spread sheets​
    8·2 answers
  • How is hashing used?
    6·1 answer
  • Kyle has a notebook for each of his 5 classes. He puts 6 stickers on each notebook. There are 10 stickers on each sheet. How man
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!