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
postnew [5]
3 years ago
9

Write a full class definition for a class named Counter, and containing the following members:________

Computers and Technology
1 answer:
kipiarov [429]3 years ago
3 0

Answer:

The class definition for above problem in java is as follows:-

Explanation:

class Counter // class counter

{

  int counter; // variable counter

  Counter(int v) // construtor

  {

      counter=v;

  }

  void increment() //increment function

  {

      counter=counter+1;

  }

  void decrement() //decrement function

  {

      counter=counter-1;

  }

  int getValue() //getvalue function

  {

      return counter;

  }

}

Code Explanation:

  • The above class definition is in java language.
  • In this code, the name of the class is a Counter and it holds the three functions (increment, decrement and getvalue) and one constructor which is mentioned in the question.
  • To call the above class and their function firstly the user needs to create an object of the counter class in the main function by passing the one integer value on it.
  • The object declaration statement calls the constructor.
  • And then any function can be called by the object of the class with the help of the dot operator.
You might be interested in
Instead of typing an individual name into a letter that you plan to reuse with multiple people, you should use a _______ to auto
marin [14]

Answer:

A. Mail Merge

Explanation:

I had this question last year

6 0
3 years ago
Which is the most visual social media site?
Aleks04 [339]
Enge extrapolated this analysis across the 2.2 billion<span> users on Google and concluded that while the “active profiles” on Google+ amount to </span>111 million<span> users, only 6.7 million users have 50 or more posts ever, and only 3.5 million have 50 or more posts in the last 30 days</span>
3 0
3 years ago
What is typically unique in each database table?
andriy [413]

ID number APEX  answer

4 0
3 years ago
Read 2 more answers
Which major nims component describes systems and methods
Ivahew [28]

Answer:

Communications and Information Management describes systems and methods that help to ensure that incident personnel and other decision makers have the means and information they need to make and communicate decisions.

6 0
2 years ago
Drag each label to the correct location. Each label can be used more than once. Match the device to the port through which it co
son4ous [18]

Answer:

Mouse - USB

Monitor - display port, HDMI, and thunderbolt port

External hard drive - USB and thunderbolt port

Flash drive - USB

Explanation:

A computer mouse is an input device used to interact with a computer system. It connects with the computer through the USB port.

A Monitor is an output device that is used to display information on a computer system. It can be connected to the system through the display ports, HDMI, and the thunder port.

The External hard drive is a storage device that holds data for a long period of time. It has adapters to connect to the computer through the USB ports or thunderbolt ports. The flash drive is similar in function to the hard drive but small in size and storage space. It only connects with the computer through USB ports.

5 0
3 years ago
Other questions:
  • Conceptual note-taking is the act of
    15·1 answer
  • Which of the following roles is responsible for writing programming code?
    10·1 answer
  • A patient presents at an outpatient urgent care facility with an acute illness and is seen by a provider. A detailed history wit
    13·1 answer
  • Generate an array x that has n=100 random numbers that are uniformly distributed over the interval [0,1) . Look up how to use th
    8·1 answer
  • A) Write 600 as the product of prime factors.<br> Give your answer in index form.
    7·2 answers
  • Select the correct answer.
    5·1 answer
  • Who developed the idea of a universal network?
    11·1 answer
  • Anyone who know hacking​
    7·1 answer
  • Write a statement that slices a substring out of the string quote and puts it into a variable named selection. If given the stri
    8·1 answer
  • Given a list of syntax errors from a compiler, a programmer should focus attention on which error(s), before recompiling?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!