Computers and Technology
Computers and Technology, 05.07.2021 19:30, bunnles

Code in Java: 1) Assume there is a class named Animal with an attribute named name of type String and a get method named getName. Assume there are two objects a1 and a2 of type Animal already declared and their names are already set. Write a java expression that checks if the names of the Animal objects a1 and a2 are equal.
2) Assume there is a class named Car with an attribute named model of type String and a get method named getModel. Assume there is an object c1 of type Car already declared and its model already set. Write a java statement that sets the variable ch of type char ( already declared) to the third character of the c1's model.
3) Assume there is a class Lamp having a private attribute named status of type boolean. Write a method named whatIsStatus for the Lamp class that accepts a Lamp object as its parameter and returns a text value based on the status of the passed object as follows:
if the status is true return "ON" , if the status is false return "OFF" , otherwise return "ERROR".

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:30, reinasuarez964
One of your customers wants you to build a personal server that he can use in his home. one of his concerns is making sure he has at least one backup of their data stored on the server in the event that a disk fails. you have decided to back up his data using raid. since this server is for personal use only, the customer wants to keep costs down. therefore, he would like to keep the number of drives to a minimum. which of the following raid systems would best meet the customer's specifications? a. raid 0 b. raid 1 c. raid 5 d. raid 10
Answers: 3
image
Computers and Technology, 23.06.2019 13:30, gamingisfun
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
image
Computers and Technology, 23.06.2019 14:00, savannnab1890
Select the correct answer. andre was recently hired by an organization to check for system vulnerabilities. he is supposed to exploit these vulnerabilities and create a report on the extent of damage to which the system was susceptible. what position does andre hold in this organization? a. information security analyst b. information assurance manager c. penetration tester d. network security engineer e. chief information security officer
Answers: 2
image
Computers and Technology, 24.06.2019 09:30, bhadd4385
What is the definition of digital literacy?
Answers: 1
Do you know the correct answer?
Code in Java: 1) Assume there is a class named Animal with an attribute named name of type String a...

Questions in other subjects: