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
To make the monster pace, you needed the monster to turn ___ degrees.
dangina [55]

To make the monster pace, you needed the monster to turn <u>180 degrees</u>: option 2.

<h3>What is graphic design?</h3>

Graphic design refers to an artistic process that is used for the creation of either two-dimensional or three-dimensional art works and animations, especially through the use of special application software.

In Computer technology, objects can be designed and developed to move from one point to another based on a set of executable codes and parameters.

In this context, you needed the monster to turn <u>180 degrees</u> so as to enable it face a forward direction and then, allow it to pace or be in motion.

Read more on graphic design here: brainly.com/question/25299426

#SPJ1

7 0
2 years ago
The need to strike a<br>- among work, life, family, and other responsibilities is<br>universal.​
Dmitriy789 [7]
The need to strike is purposely to create unity and equal rights for what a group might feel is unfair .
4 0
3 years ago
The _____ class can be used to get user input using dialog boxes.
Ber [7]

Answer:

JOptionPane

Explanation:

  • The class "JOptionPane" are used to pop / create dialogue boxes for the user to enter the input for a question.
  • JOptionPane contains methods to create input dialogue boxes, message dialogue boxes, option dialogue boxes and confirm dialogue boxes.
  • The dialogue boxes can be just message dialogue boxes which gives some message to the user. It doesn't require anything to be input from the user. It is just a message box.
  • Where as input dialogue box requires the user to input something.
  • Confirm dialogue box asks the user to answer a question yes / no / cancel.
  • Option dialogue box asks the user to select the options.
  • So, option (d) JOptionPane is the answer for the question.
  • Option (a), (b) and (c) are used for different purposes but not to create dialogue boxes. So, options (a), (b) and (c) are not the correct answers for the question.
4 0
3 years ago
Consider a file system that uses inodes to represent files. Disk blocks are 2KB in size and a pointer to a disk block requires 4
deff fn [24]

Answer:

a.  Maximum size of file = 8.003 GB

Explanation:

<u>a. Maximum size of file</u>

= (6 * 2 KB) + (2048 * 2 KB) + (2048 * 2048 * 2 KB)

= 12kb + 4096 Kb +  8388608 kb

= 8392716 kb

8392716/1024 mb = 8196.01 MB

8196.01 /1024 GB= 8.003 GB

<u>b. According to above calculation</u>

For 8 GB 6 direct, 1 single and 1 double indirect block requires

so

for 32 GB

24 direct Block

4 single and 4 double indirect block requires

7 0
4 years ago
Lord Strawberry, a nobleman, collected birds. He had the finest aviary in Europe, so large that eagles did not find it uncomfort
creativ13 [48]

Answer:

That was a very great story that I totally did NOT read cause it too long 0-0.

Explanation:

To my ferns.....GET ON RN CAUSE I WONLEY T^T

Anyways wuv c'alls and have a good day :3

8 0
3 years ago
Other questions:
  • WILL DO A BRAINLY! help pls.
    15·1 answer
  • In which type of land contract does the seller earn interest on the difference between what the seller owes on an existing loan
    14·1 answer
  • Hackers who gain control over several computers can organize them into a client-server network known as a(n) __________ . This n
    7·1 answer
  • If you decide to get married, a trade-off would be that you have to give up being single.
    12·2 answers
  • Which function will add a name to a list of baseball players in Python?
    13·2 answers
  • Which option in Outlook allows a user to look at multiple calendars in a side-by-side fashion?
    14·2 answers
  • Using Phyton
    9·1 answer
  • PLEASE HELP!
    14·2 answers
  • Wha are the types of slide show? define​
    10·1 answer
  • Part of the operating system core is responsible for controlling security, managing the file system, and providing a platform fo
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!