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
You have a folder on your Windows desktop system that you would like to share with members of your development team. Users need
horrorfan [7]

Answer:

modify the NTFS permissions on the folder

Explanation:

In order to solve this problem what you need to do is to modify the NTFS permissions on the folder. The NT File System permissions are security measures blocking access to manipulation of files within a directory and affects local users as well as network users. By adjusting the permissions of this within the folder that the members are trying to access then it will give them the ability to modify the files.

5 0
3 years ago
What phrase best describes the overall structure of the<br> passage
creativ13 [48]

Answer: The one that gives you more vibe that its correct.

Explanation:

3 0
3 years ago
What is a form of technology that you think will make your life easier?
zzz [600]

Answer:

Digital communication technologies

Explanation:

connecting people across the globe has become easier and faster. Platforms such as Zoom, Room, Microsoft teams, WebEx, and many others are buzzing virtual world spaces to connect and share.

5 0
2 years ago
Among object-oriented languages, one feature that varies considerably is whether the language allows multiple inheritance. C++ d
Amiraneli [1.4K]

Multiple inheritance causes Diamond problem which happens when:

Class A is parent of class B and C

Now when class D will be inherited from both Class B and C it will have all the members of class A and B which if same will confuse the compiler to import which one?

C++ solves it by using virtual keyword with them and thus telling the compiler which one to inherit.

Java has introduced the interface concept rather then allowing multiple inheritance.

4 0
3 years ago
Which body of water is most likely to be a marine ecosystem?
Sophie [7]

Answer:

The body of water that is most likely to be a marine ecosystem would be an estuary.

Explanation:

An estuary is a widened, often funnel-shaped mouth of a river, where fresh river water and salt sea water are mixed and thus brackish water is created, and where tidal differences can be observed. When a river flows as a system of branches, it is called a delta.

Estuaries often have a great natural value. They typically consist of swallows and salt marshes that are very rich in invertebrates and thus have a great attraction for birds, among other things.

4 0
2 years ago
Other questions:
  • How do you open Microsoft Excel 2013 with Windows 8?
    13·1 answer
  • A motherboard uses dual channeling, but you have four DIMMs available that differ in size. The motherboard supports all four siz
    7·1 answer
  • Suppose the information content of a packet is the bit pattern 1110 0110 1001 1101 and an even parity scheme is being used. What
    15·1 answer
  • The _____ is a blinking vertical line that indicates where the next typed character will appear. scroll box sheet tab insertion
    7·1 answer
  • JavaBeans are?A special Java classfileServletsAppletsA Special form of JSPNone of Given
    8·1 answer
  • The___provides access to the internet; may also be internal
    11·1 answer
  • Anthony is responsible for tuning his organization's intrusion detection system. He notices that the system reports an intrusion
    8·1 answer
  • 8.Which of the following IC was used in third generation of computers?Immersive Reader
    13·1 answer
  • 4.(L.5.1.A) Select the sentence that includes an interjection,
    12·1 answer
  • Select the correct technical term for each definition by using the drop-down menus.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!