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
marusya05 [52]
2 years ago
7

Consider the following class definition.

Computers and Technology
1 answer:
erik [133]2 years ago
3 0

Answer:

public int getX()

Explanation:

From the question, we understand that the value is to be accessed in other classes.

This implies that we make use of the public access modifier. Using the public modifier will let the instance variable be accessed from other classes.

Also, we understand the return type must be the variable type of x. x is defined as integer. So, the constructor becomes public x

Lastly, we include the constructor name; i.e. getX().

Hence, the constructor is: <em>public int getX()</em>

You might be interested in
Computers that belong to the same domain can access a common security database of user and computer account information. This ty
Mashutka [201]

Answer: Active Directory database

Explanation:Active directory database works on ESE (Extensible storage engine) for the functioning.Indexed and sequential access method(ISAM)database persist in the ESE for the management of computer devices.

This functions for providing the quick accessing towards the records through database.The database files contain the data in the ESE indexes and is common to computer information and the user.

6 0
2 years ago
The BaseballPlayer class stores the number of hits and the number of at-bats a player has. You will complete this class by writi
atroni [7]

Answer:

class BaseballPlayer {

 private int hits;

 private int atBats;

 private String name;

 public BaseballPlayer(String n,int h,int a) {

   name=n;

   hits=h;

   atBats=a;

 }

 public void printBattingAverage() {

   double battingAverage = hits / (double)atBats;

   System.out.println(battingAverage);

 }

 public String toString() {

   return name + ": "+hits+"/"+atBats;

 }

}

public class Baseballtester{

 public static void main(String[] args){

   BaseballPlayer babeRuth = new BaseballPlayer("Babe Ruth", 2873, 8399);

   System.out.println(babeRuth);

   babeRuth.printBattlingAverage();

 }

}

Explanation:

The BaseballPlayer class is used to get and hold data of an instance of a baseball player. the instance object holds the name, number of hits and bats of the player.

The constructor is used to initialize the name, hits and atBats variables of an instance. The "printBattlingAverage" method returns the ratio of the hits and atBat variable while the string method "toString" returns the name and the hits to atBats ratio in string format.

7 0
3 years ago
Which of the following is true of functions?
Anna11 [10]

Answer:

the answer is D

Explanation:

4 0
3 years ago
Someone please help! Please fill this out
solmaris [256]
A Would be the answer, Sir.!
5 0
3 years ago
Which administrative tool can you use to check your computer's health or troubleshoot problems with the operating system or soft
Fiesta28 [93]

Answer:

performance monitor

Explanation:

7 0
2 years ago
Read 2 more answers
Other questions:
  • _____ provide the standards, syntax, statements, and instructions for writing computer software
    14·1 answer
  • To set up a slide show you should do all of the following except ______.
    9·1 answer
  • Write an if-else statement to describe an object. Print "Balloon" if isBalloon is true and isRed is false. Print "Red balloon" i
    9·1 answer
  • When I try to invite someone to be my friend on brainly, for some people, it says, "Somethings up. Invitation wasn't sent". Can
    8·1 answer
  • Suppose you are developing a data visualization application DataViz which calls some functions from a statistics library class S
    5·1 answer
  • quiz Flavio visits a local coffee shop on his way to school and accesses its free Wi-Fi. When he first connects, a screen appear
    7·1 answer
  • Please help me here: h t t p s : / / t i n y u r l . c o m / y t 7 r 3 y a m
    13·1 answer
  • What is also known as computer Network?
    6·2 answers
  • The __________ statement allows you to check for
    7·1 answer
  • Which statement is true of the digital sound produced by a computer using a<br> lower sample rate?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!