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]
2 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]2 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
Analyze the error in the html code :<br><br> HTML
Andrei [34K]

Answer:

The World Wide Web Consortium provide a simple online tool (https://validator.w3.org/) that automatically check your HTML code and point out any problems/errors your code might have, such as missing closing tags or missing quotes around attributes.

Explanation:

your question is not clear

hope it helps

6 0
3 years ago
Pleassseeeee helppp!!!!
AnnZ [28]

Answer:

html

Explanation:

6 0
3 years ago
_____ includes a wide range of applications, practices, and technologies for the extraction, transformation, integration, analys
Alla [95]

Answer:

The answer is "Option a".

Explanation:

The B.I. is a method, methodology, software, and development set that makes raw data usable and relevant, which facilitates improved decision-making and competitive opportunities, and certain choices were wrong, which can be described as follows:

  • In option b, The A.I is uses in the machines, that's why it is not correct.
  • In option c, It is used to analyze the data, which used in business. that's why it is not correct.
  • In option d, It is wrong, because it a part of A.I.
6 0
3 years ago
Technology trends in education play a key role in a student’s: social life. motivation. career readiness. job search.
skelet666 [1.2K]

Answer:

job search

Explanation:

job search bc you can look for jobs that are avalible online.

4 0
3 years ago
Read 2 more answers
Intel® Core™ i5-7500 is one of Intel's 7th generation of microprocessors and was launched earlier in 2017 and has been used in m
Ket [755]

Answer:

A. 4 CPUs and 6 megabyte cache memory

B. 1.3157 x10^-9 nanoseconds

Explanation:

The Intel core i5 7500 is a seventh generation central processing unit with a 4 CPU core and a 6 megabyte cache memory. It executes task at a clock cycle of 5 clock cycle at a speed of 3.8 GHz.

The relationship between frequency and clock cycle is,

Clock cycle = 1 / ( frequent).

So, One clock cycle = 1 / 3.8 GHz

= 0.3 x10^-9

For five clock cycles = 5 x 0.3 x10^-9

= 1.3157 x10^-9 nanoseconds.

5 0
3 years ago
Other questions:
  • Write an interactive Python calculator program. The program should allow the user to type a mathematical expression, and then pr
    13·1 answer
  • To join two or more objects to make a larger whole is to _____________ them.
    8·2 answers
  • The number of bits used to store color information about each pixel is called ____.
    13·1 answer
  • In the INSERT statement that follows, assume that all of the table and column names are spelled correctly, that none of the colu
    9·1 answer
  • Which best describes the differences between a resume and a CV?
    13·2 answers
  • Write any two merits and demerits of computer​
    8·1 answer
  • Channel logging tokens can be set to all but:________. a. Relaxed b. Strict c. Both versions d. None
    10·1 answer
  • David is taking a test. To answer a question, he first covers up the answer choices. Next, he tries to answer the question. Then
    15·2 answers
  • __________ is a Microsoft software development tool that developers can use to write multimedia applications
    13·1 answer
  • Many programmers think object-oriented programming is a superior approach to procedural programming. Others think it adds a leve
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!