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
strojnjashka [21]
3 years ago
12

You have been handed a mysterious piece of data by an unknown person. Judging by his shifty eyes and maniacal laughter you don't

think he can be trusted. Complete the below method to tell you the type for this unknown data. The example already implemented can be adapted for other wrapper classes as well. Complete the method to analyze String, Character, and Double. Examples: whatAmI(1) -> "Integer" 1 public String whatAmI(E e) { 3 //.getClass() returns the runtime class of an object //.equals() determines whether two objects are equivalent //by calling a new static instance of a wrapper object we can analyze //it's class type and compare it to the variable passed in if(e.getClass().equals(new Integer(1).getClass()) { return "Integer"; }else{ return "Who knows!"; Given a word, use a stack to reverse the word and return a new string with the original word in reverse order. You cannot use the reverse string methods in the String class. Examples: reverseword("hello") -> "olleh" reverseword("hallo") -> "ollah" i public String reverseWord(String word) Stack character> stack = new Stack ;
Computers and Technology
1 answer:
irga5000 [103]3 years ago
5 0

Answer:

Java Code given below with appropriate comments for better understanding

Explanation:

1.

public String whatAmI(E e) {

//.getClass() returns the runtime class of an object

//.equals() determines whether two objects are equivalent

//by calling a new static instance of a wrapper object we can analyze

//it's class type and compare it to the variable passed in

if(e.getClass().equals(new Integer(1).getClass())) {

return "Integer";

}

else if(e.getClass().equals(new String("1").getClass())) {

return "String";

}

else if(e.getClass().equals(new Double(1.0).getClass())) {

return "Double";

}

else {

return "Who knows!";

}

}

2.

public String reverseWord(String word) {

   Stack<Character> stack = new Stack<Character>();

   for (int i = 0; i < word.length(); i++) {

       stack.push(word.charAt(i));

   }

   String result = "";

   while (!stack.isEmpty()) {

       result += stack.pop();

   }

   return result;

}

You might be interested in
I need help with question 3 I’ll give brainliest
Semmy [17]

Answer:

D) Engineering and Technology

Explanation:

Brent Designs or <em>Engineers </em>the equipment or<em> Technology </em>that is used to keep the plant safe.

7 0
3 years ago
Read 2 more answers
Generally speaking, the _______ the risk, the _______ the potential return or loss
givi [52]
<span>The correct answer is higher for both blank spaces.

We all know the famous saying: "No risk, no reward". What is true is the higher your risk you also have a higher degree of reaping a higher rewards. But the opposite is also true, the more you risk the more you stand to lose. In stockbroker business this is best exemplified, as you can se brokers trying to predict the stock market in order to make greater profits. Gambling is also the good example of this. </span>
6 0
3 years ago
Read 2 more answers
Which of these is a historic real-world simulation game?
harkovskaia [24]

Answer:

B. Archery

Explanation:

the art, practice, or skill of shooting with bow and arrow

7 0
2 years ago
In Microsoft PowerPoint, a _____ gives viewers a visual image of data, such as a line graph or a three-
Vera_Pavlovna [14]

Answer:

graph

Explanation:

I don't know anything else that would be a visual representation of data.

5 0
3 years ago
Alexander studies sitting on the edge of his bed with his laptop on his lap. he complains of a sore neck. how can he best improv
kumpel [21]

The way in which Alexander can best improve his study area is that: D. he can put his computer on a desk and sit in a comfortable chair.

<h3>What is a laptop?</h3>

A laptop can be defined as a small, portable type of computer that is designed and developed by embedding both a mousepad and keyboard on it.

Also, it is usually light enough to be placed on an end user's lap while he or she is working.

In this scenario, the way in which Alexander can best improve his study area is that he can put his computer on a desk and sit in a comfortable chair.

Read more on a laptop here: brainly.com/question/26021194

#SPJ4

7 0
2 years ago
Other questions:
  • The keyboard, mouse, trackpad, microphone, light pen, and voice recognition are examples of _____ devices.
    5·1 answer
  • Schools are businesses that need to install software on a large number of computers can usually obtain a ______
    13·1 answer
  • Which of these statements about cell references is NOT true?
    10·2 answers
  • What types of storage can be used to access your data on another computer?
    6·2 answers
  • If you were setting up a network with 100 nodes and you wanted no more than 25 nodes per segment: what devices and connections w
    9·1 answer
  • Some computer engineering students decided to revise the LC-3 for their senior project. In designing the LC-4, they decided to c
    13·1 answer
  • To speed up item insertion and deletion in a data set, use ____.
    12·1 answer
  • PLEASE HELP!!!!
    6·2 answers
  • Alvin has created a non-extensive site map of all the commonly visited pages of his website. What is such a site map called?
    13·1 answer
  • 1. This tab displays the related commands which are grouped as Pages, Tables, Illustrations, Links, Header and Footer, Text, Sym
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!