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]
3 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]3 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
What is output if the user enters -5?
7nadin3 [17]

Answer:

The left

Explanation:

6 0
3 years ago
Read 2 more answers
Ellen's laptop has a built-in 802.11n-capable wireless NIC. The wireless NIC worked perfectly yesterday when she loaned it to he
Flura [38]

Answer:

The NIC is disabled in CMOS

Explanation:

CMOS refers to the Complementary Metal Oxide Semiconductor.  It is a technology that is used to generated integrated circuits.

It can be found in various types like microprocessors, batteries, etc

While on the other hand the NIC refers to the network interface controller in which the component of the computer hardware has connected the computer to its network. It can be done via wired and wireless.

Since in the given situation, it is mentioned that Ellen is not able to access the internet through wireless NIC neither it is visible in network connections nor it is shown in device manager so first she assumes that is nic is disabled in CMOS

and the same is to be considered

6 0
3 years ago
Which file types have .exe and .png as their extensions?
cricket20 [7]
EXE files are executable files.
PNG files are picture files like JPEG etc.
7 0
4 years ago
Which of these is an on-site metric for social media marketing?
love history [14]
The answer to you question is C
3 0
3 years ago
Which part of an I-statement involves a description of your needs or feelings? The part of an I-statement involves a description
MrMuchimi

The part of an I-statement that involves a description of

your needs or feelings is the Feelings Statement.



The feelings statement is a description of your feelings that is linked to a

particular situation. Vague feelings often create frustration in the listener.



6 0
3 years ago
Read 2 more answers
Other questions:
  • Which career professional and creates large data base and makes the data base with other systems
    13·1 answer
  • Describe mobile computing
    7·1 answer
  • At the Network layer, what type of address is used to identify the receiving host?
    10·1 answer
  • Which remote assistance option requires peer name resolution protocol (pnr) and ipv6?
    5·1 answer
  • How do you give the brainliest answer to someone?
    8·2 answers
  • ________ is/are used to temporarily hold small units of program instructions and data immediately before, during, and after exec
    11·1 answer
  • Titus would like to make his products stand out a little more in his Excel spreadsheet. What actions would help to distinguish o
    15·1 answer
  • Take a minute to reflect on your thoughts and learning so far and discuss:
    13·1 answer
  • If you need to change the typeface of a document, which menu will you choose?
    6·1 answer
  • Which item is developed last in the cyclical process?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!