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
Strike441 [17]
2 years ago
8

Define a toString prototype method that returns the cat's name, gender, and age separated by semicolons.

Computers and Technology
1 answer:
nexus9112 [7]2 years ago
6 0

Answer:

Following are the program to this question:

import java.util.*;//import package for user input

public class Main//defining main class

{

public static String Cat (String name, String gender, int age)//defining string method Cat that accept parameter value

{

return name + ';' + gender + ';' + age;//return parameter value

}

public static void main(String[] args) //defining main method

{

   String name,gender;//defining String variable

   int age;//defining integer variable

   System.out.println("Enter name, gender and age: ");//print message

   Scanner obx=new Scanner(System.in);//creating Scanner class object for user input

   name=obx.next();//input name value

   gender=obx.next();//input gender value

   age=obx.nextInt();// input age value

   System.out.println(Cat(name,gender,age));//print return method value

}

}

Output:

Enter name, gender and age:  

dani

Female

12

dani;Female;12

Explanation:

In the above-given code, a string method Cat is declared, that accepts three variable "name, gender, and age", inside the method return keyword is used that returns the parameter values.

In the main method, the above parameter variable is declared, which is used to input value from the user-end, and used the print method to print its return value.

You might be interested in
2. Consider the two-dimensional array A: int A[][] = new int[100][100]; where A[0][0] is at location 200 in a paged memory syste
bogdanovich [222]

Answer:

Check the explanation

Explanation:

An integer (int) is of two different bytes and each page has 200 bytes in length. What this means is that each row of array A (100 int) will fits perfectly in a page.

(a) For the initial or first array-initialization loop, one column is processed at a time, so a page fault will be generated at every inner loop iteration, with a total of 100*100=10,000 page faults.

(b)  And when it comes to the second array-initialization loop, one row is processed at a time, and a page fault is generated at every outer loop iteration, with a total of 100 page faults.

Hence second array-initialization loop, has better spatial locality.

6 0
3 years ago
Nina visited an area that receives a large amount of precipitation during all twelve months and is typically warm year round. Th
slava [35]

Answer: Rainforest

Explanation:

A rainforest is an area that typically has tall, green trees and also has a high amount of rainfall. Rainforest can be found in the wet tropical uplands and lowlands. The largest rainforests can be seen in the Amazon River Basin.

Since the area visited by Nina has a large amount of precipitation during all twelve months, typically warm year round and has a large variety of organism diversity, then the biome thatcNina most likely visited is the rainforest.

7 0
3 years ago
Telepresence provides the opportunity for people to work from home and attend virtually. True False
ira [324]
The answer is true.
Telepresence is essentially things like video-chat that allows people to participate in meetings even if they are not physically present.

I hope this helps! :)
~ erudite 
7 0
3 years ago
Read 2 more answers
The concept of a process in an operating system embodies two primary characteristics, one of which is:
miv72 [106K]

Answer:

Resource Ownership and Scheduling execution

Explanation:

In process characteristic the characteristic is

  • Resource ownership
  • Scheduling / Execution

In Resource ownership, the OS performs a protection function where unwanted interference in processes are with resources

In scheduling execution, the process has execution state and scheduled. They can be separated by resource ownership.

The dispatching of the process is the lightweight process, and it is multi-threading. The ability of the operating system supports the single concurrent process.

The process is a unit in the resource protection and protected the CPU and other processes. It contains the multiple thread execution

Each thread contains the running, ready state and saved the thread context and access the memory. Some necessary activities of the various threads are the same address space and the resources.

7 0
3 years ago
What is a functionalist perspective of cell phones, internet and personal computers?
Sedbober [7]
<span>As these technologies are rapidly evolving a functionalist would say that they unbalance the equilibrium of the social state, and is therefore undesirable as there is more interaction and adaptation of habits from other societies. But they also say that it's not a good thing to change immediately because it might disrupt the society. Therefore it has to change slowly. </span>
3 0
3 years ago
Other questions:
  • Using a database of precomputed hashes from sequentially calculated passwords called a(n) __________, an attacker can simply loo
    14·1 answer
  • If in your checkout cart right before you buy something there is an option saying "this order contains a gift." on amazon, what
    7·1 answer
  • Which one of the following is an example of hacktivism according to you and why?
    11·1 answer
  • Write the definition of a method printarray, which has one parameter , an array of int s. the method does not return a value . t
    10·1 answer
  • The Circle of Growth
    10·1 answer
  • When you’re in the Normal view, what are the visible panes?
    15·2 answers
  • What is the exact number of bits in a memory that contains (a) 128k bits?
    9·1 answer
  • EIPP:________.
    9·2 answers
  • Which part of a computer takes the text and pictures on your screen and prints them onto paper?
    6·1 answer
  • Where do animators work?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!