Consider the following class. public class ClassicClass { private static int count = 0; private int num; public ClassicClass() { count++; num = count; } public String toString() { return count + " " + num; } } What is printed when the following code in the main method of another class is run? ClassicClass a = new ClassicClass(); ClassicClass b = new ClassicClass(); ClassicClass c = new ClassicClass(); System.out.println(a + ", " + b + ", " + c);

Answers

Answer 1

The the code in the main method is run, it will print

"3 1, 3 2, 3 3"

The static/class field count stores the number of instances of the class created. count is always incremented when the instance constructor is called.

The instance field num acts like an identifier/serial number for the instance created. When the constructor is called, the current count is stored in the num field of the instance.

Each instance's toString( ) method will output the total count (from count) and the serial of the instance (from num).

When the code runs in the main method, it creates three instances (making count==3), so that we have

a = {count: 3, num: 1}b = {count: 3, num: 2}c = {count: 3, num: 3}

and implicitly calls toString( ) in the println method for each of the three instances to produce the following output

"3 1, 3 2, 3 3"

Learn more about programs here: https://brainly.com/question/22909010


Related Questions

HELP ME ILL GIVE BRAINLY Input 50 numbers and then output the average of the negative numbers only. Write in pseudocode!

Answers

Answer:

The explanation is for 10 inputs though. You'd have to follow these steps to find input 50 numbers.

Explanation:

This is how I wrote it in the Plain English programming language which looks like pseudo-code but compiles and runs (to save you all the rest of the steps):

To run:

Start up.

Write "Enter 10 numbers separated by spaces: " on the console.

Read a reply from the console.

Loop.

If the reply is blank, break.

Get a number from the reply.

Add 1 to a count.

Add the number to a total.

Repeat.

Write "The total is: " then the total on the console.

Put the total divided by the count into an average.

Write "The average is: " then the average on the console.

Refresh the screen.

Wait for the escape key.

Shut down.

Do you have any concerns or worries about how you will manage your course assignments or expectations? Your journal entry will only be seen by you and your instructor, so feel free to share any questions and worries you have.

Answers

Answer:

no worries at all.

yeah-ya..... right?

What symbol must go at the end of an if statement?

Answers

::::::::
a period (.)

Answer: the pireod .

Explanation:

I love dogs & cats.

Write a function named partfthat takes inas parameterstwo parallel lists: a list of times (in increasing order), and a list of distance traveled by that point in time. The function should return a new list giving the average velocity between consecutive time measurements. The new list should have a length of one less than the original lists.

Answers

The program calculates the velocity between points in a list is written below. The program is written in python 3 thus ;

t = input("Enter time values : ")

#Enter the time values of the data

p = input("Enter distance values : ")

#Enter the distance values

dist = [float(x) for x in p.split()]

time = [float(x) for x in t.split()]

#pyt then values in a list

def partfthat(dist, time):

#initialize function that takes in two parameters

vel = []

#empty list to hold the calculated velocity values

i = 0

#indexer

while i <= len(dist)-2:

#while loop to iterate

v = (dist[i+1] - dist[i]) / (time[i+1] -time[i])

#Use the velocity formula

vel.append(v)

#append values to the empty list created

i+=1

return vel

print(avg_vel(dist, time))

A sample run of the program is attached.

Learn more : https://brainly.com/question/25681441

When you create a _____ query, the value the user enters in the dialog box determines which records the query displays in the results. a. parameter

Answers

When a parameter query is created, the value entered in a dialog box by an end user determines the record that would be displayed in the results.

A query refers to a computational request for data (information) that are saved either in a database table, from existing queries, or from a combination of both a database table and existing queries.

Basically, there are four (4) main types of query and these include:

Select query.Action query.Aggregate query.Parameter query.

A parameter query is designed and developed to display a dialog box that prompts an end user for data or field criteria, which determines the record that would be displayed in the results.

Read more: https://brainly.com/question/23388493

For security reasons, the network administrator needs to prevent pings into the corporate networks from hosts outside the internetwork. Which protocol should be blocked with access control lists

Answers

Answer:

ICMP

Explanation:

The capability of moving a completed programming solution easily from one type of computer to another is known as ________. Group of answer choices

Answers

Answer: Portability

Explanation: I hope it helps you!

Write a python function to compute a certain number to a given power. The program should continue asking the user for number and power and display the result until the user enters 0 as the number. Note: don't use the power function of Python. Compute the power using a for or a while loop.

Answers

while True:

   number = int(input("input the number: "))

   exponent = int(input("input the exponent : "))

  if number == 0:

       break

   else:

       result = 1

       while exponent != 0:

           result *= number

           exponent-=1

       print("Answer = " + str(result))

   

we are asked not to use the power function of python. The question wants us to use a for or a while loop to compute the power.

The while loop makes sure the user is always asked to input the number and an exponent.

If the users number equals 0, the while loop will break.

Else the code will find the power of the number.

Finally, we print the answer if the user number is not zero

The bolded part of the code are python keywords.

read more: https://brainly.com/question/12992668?referrer=searchResults

What does “The Principle of Least Privilege” mean as applied to security?

Answers

Answer:

The principle of least privilege (PoLP) refers to an information security concept in which a user is given the minimum levels of access – or permissions – needed to perform his/her job functions. ... Least privilege enforcement ensures the non-human tool has the requisite access needed – and nothing more.

Explanation: let me know if this helps!

3 3) Why computer is called non-inteligent , IN Dull machine?

Answers

Answer:

Computers are dull: The CPU is the Central Processing Unit or the brains of the computer. The CPU knows what to do with machine language instructions. It doesn't understand them; it just knows what to do with them.

Explanation:

Hope I could help.

                                 please mark as brainliest

We can find out how robots work by looking in detail at the smaller parts. What do we call this?

Answers

Answer: This can be called the engineering.

Explanation:

Because the small parts is the bearings inside the robot

What is the full form of MPEG? The full form of MPEG is blank.

Answers

Answer:

Moving Picture Experts Group

Explanation:

Answer:

The full form of MPEG is Moving Picture Experts Group.

Explanation:

MPEG is a group of working experts to determine video or audio encoding and transmitting specifications/standards.

Sebutkan contoh komputer analog, komputer digital, dan komputer hybrid

Answers

Answer: the examples of analog computer is voltmeter

Example of digital computer is tablet,mobile etc

Example of hybrid computer is digital meters used nowadays in cars etc

discuss the communicatin process giving detailed explanation on each process​

Answers

Communications is fundamental to the existence and survival of humans as well as to an organization. It is a process of creating and sharing ideas, information, views, facts, feelings, etc. among the people to reach a common understanding. Communication is the key to the Directing function of management.

A manager may be highly qualified and skilled but if he does not possess good communication skills, all his ability becomes irrelevant. A manager must communicate his directions effectively to the subordinates to get the work done from them properly.

Communications Process

Communications is a continuous process which mainly involves three elements viz. sender, message, and receiver. The elements involved in the communication process are explained below in detail:

1. Sender

The sender or the communicator generates the message and conveys it to the receiver. He is the source and the one who starts the communication

2. Message

It is the idea, information, view, fact, feeling, etc. that is generated by the sender and is then intended to be communicated further.

Browse more Topics under Directing

Introduction, Meaning, Importance & Principles of DirectingElements of DirectionIncentivesLeadership

3. Encoding

The message generated by the sender is encoded symbolically such as in the form of words, pictures, gestures, etc. before it is being conveyed.

4. Media

It is the manner in which the encoded message is transmitted. The message may be transmitted orally or in writing. The medium of communication includes telephone, internet, post, fax, e-mail, etc. The choice of medium is decided by the sender.

5. Decoding

It is the process of converting the symbols encoded by the sender. After decoding the message is received by the receiver.

6. Receiver

He is the person who is last in the chain and for whom the message was sent by the sender. Once the receiver receives the message and understands it in proper perspective and acts according to the message, only then the purpose of communication is successful.

7. Feedback

Once the receiver confirms to the sender that he has received the message and understood it, the process of communication is complete.

8. Noise

It refers to any obstruction that is caused by the sender, message or receiver during the process of communication. For example, bad telephone connection, faulty encoding, faulty decoding, inattentive receiver, poor understanding of message due to prejudice or inappropriate gestures, etc.

Queries are questions true or false?

Answers

Answer:

true

Explanation:

in the dictionary they mean the same thing

A large company pays its salespeople on a commission basis. The salespeople receive $900 per week, plus 8.75 percent of their gross sales for that week. For example, a salesperson who sells $10000 worth of merchandise in a week receives $900 plus 8.75 percent of $10000, or a total of $1775. You have been supplied with a list of the products sold by each salesperson. The values of these products are as follows:
Item Value
1 100
2 200
3 300
4 400
Develop a script that inputs one salesperson’s items sold for last week, calculates the salesperson’s earnings and outputs HTML5 text that displays the salesperson’s earnings.

Answers

Answer:

Explanation:

#include
void main()
{
int m=45,first,last;
first=m/10;
last=m%10;
printf("%d",first);//line 1
printf("\n%d",last);//line 2
printf("\nSum=%d",first*last);//line 3
printf("\n%d",first*last);//line 4
printf("\n%d",last*last);//line 5
printf("\nCube=%d",first*first*first);//line 6
}


Select the correct output for line 1 ~
1 point
4
5
0

Answers

Answer:

4

Explanation:

45 divided by 10 using integer division is 4

I ran the program, output is below.

Write a function remove_duplicates that removes duplicates from an array. For example, if remove_duplicates is called with an array containing 1, 4, 9, 16, 9, 7, 4, 9, 11 … then the array is changed to 1, 16, 7, 4, 9. 11. Your function should have a reference parameter for the array size that is updated when removing the duplicates

Answers

The function is an illustration of loops

Loops are used to perform repetitive operations

The function in Java where comments are used to explain each line is as follows:

//This defines the remove_duplicates function

public static int remove_duplicates(int arr[], int n){

 //If the length of the array is 0 or 1, then return the original array

 if (n == 0 || n == 1) {

  return n;

 }

 //This creates a new array

 int[] newArr = new int[n];

 

 //This initializes the index of the array to 0

 int ind = 0;

 //This iterates through the original array

 for (int i = 0; i < n - 1; i++) {

     //The following loop populates the new array with the unique elements of the original array

  if (arr[i] != arr[i + 1]) {

   newArr[ind++] = arr[i];

  }

 }

 newArr[ind++] = arr[n - 1];

 // The following loop changes the original array

 for (int i = 0; i < ind; i++) {

  arr[i] = newArr[i];

 }

 return ind;

}

At the end of the function, the duplicate elements of the array are removed

Read more about similar programs at:

https://brainly.com/question/22552591

Explain the role that the number of data exchanges plays in the analysis of selection sort and bubble sort. What role, if any, does the size of the data objects play

Answers

Answer:

The greater the number of exchanges are there greater is the complexity of the algorithm. Thus it is a measure to check for the complexity of the program.

What's computer hardware ​

Answers

the physical components that a computer system requires to function

hope it helps

Computer hardware includes the physical parts of a computer, such as the case, central processing unit, monitor, mouse, keyboard, computer data storage, graphics card, sound card, speakers and motherboard. By contrast, software is the set of instructions that can be stored and run by hardware.

Sarah was recently reviewing all the photos that she has saved on her computer and was shocked to find that she has over 10,000 images. Thankfully, digital photography will allow her to rearrange, organize, and easily search within her photos. What types of tasks are these?

A.
image evolution

B.
image formatting

C.
image editing

D.
image management

Answers

Answer:

D

Explanation:

image management

The type of task that allows Sarah to rearrange, organize, and easily search within her photos is known as Image management. Thus, the correct option for this question is D.

What do you mean by image management?

Image management may be characterized as a type of feature that allows a user to store, organize, centralize, and distribute digital images, assets, and graphics that are automatically saved in the computer. It also evaluates and enhances your image with respect to the perception of others.

According to the context of this question, image formatting nay deals with the file formatting for a digital image such as JPEG, PNG, GIF, etc. Image editing encompasses the process and strategy of acquiring alteration in the image with respect to a user.

Therefore, image management is the task that allows Sarah to rearrange, organize, and easily search within her photos. Thus, the correct option for this question is D.

To learn more about Image management, refer to the link:

https://brainly.com/question/19263329

#SPJ2

Natural language generation is focused on?

Answers

While natural language understanding focuses on computer reading comprehension, natural language generation enables computers to write. NLG is the process of producing a human language text response based on some data input. This text can also be converted into a speech format through text-to-speech services.

- BRAINLIEST answerer

Why does a computer need an operating system?

Answers

Answer:

An operating system helps it to manage and run its designed duties.

If it lacks an operating system, it wouldn't be able to work

True or False. When FTP users authenticate with an FTP server, the sign-in process can be decoded by a protocol analyzer or network sniffer software.

Answers

The File Transfer Protocol is commonly called FTP. FTP users authenticate with an FTP server, the sign-in process can be decoded by a protocol analyzer or network sniffer software is a true statement.

There are some element that often specifies the authentication settings for FTP sites. The authentication settings are known to be wired or configured at only the site-level. They can also be configured per URL.

The File Transfer Protocol (FTP) is known simply as a standard communication protocol that is often employed for the movement of computer files from a server to a client using a computer network.

It uses the client–server model architecture via different control and data connections between the client and the server.

Learn more from

https://brainly.com/question/20602197

What type of database replication relies on centralized control that determines when replicas may be created and how they are synchronized with the master copy

Answers

Database replication is very common in this Era. Traditional database replication is relies on centralized control that determines when replicas may be created and how they are synchronized with the master copy.

Database replication  is known to be the constant electronic copying of data from a database using one computer or server that is connected also to a database in another . this ensure that all users do share the same level of information.

Replication is often done to technologies which are used for copying and distributing data and database objects from one database to another and thereafter use in synchronizing between databases.

Conclusively, Replicas can only be made in the Traditional database replication through the power of centralized control.

See full question below

What type of database replication relies on centralized control that determines when replicas may be created and how they are synchronized with the master copy?

a distributed database model

b. traditional database replication

c. enterprise replication

d. local database model

Learn more about database replication from

https://brainly.com/question/6447559

You arrive at your first client meeting with Jaba's Smoothie Hut. Jaba's owner, Kim, has asked you to install a Wi-Fi network for his customers. Kim has told you that the store needs the following:

Dedicated internet service with enough bandwidth to meet customer demand and run the store.
Be cost effective (Kim does not want the most expensive or the cheapest).
Customers will use Wi-Fi and the business will have 5 wired connections

Select the correct package for the Jaba's Smoothie Hut:

a. 20 Mbps service with 1 modem/Router, a 16 port switch, and 1 wireless access point
b. 100 Mbps service with 1 Modem/Router, a 24 port switch, 3 wireless access points (1 for office, 1 for retail, and 1 for outside)

Answers

The correct package which can be used to set up the Jaba's Smoothie Hut so that there would be dedicated internet service with enough bandwidth to meet customer demand and run the store is:

b. 100 Mbps service with 1 Modem/Router, a 24 port switch, 3 wireless access points (1 for office, 1 for retail, and 1 for outside)

According to the given question, we are asked to show the correct package which can be used to set up the Jaba's Smoothie Hut so that there would be dedicated internet service with enough bandwidth to meet customer demand and run the store

As a result of this, we can see that when using wireless networks (WiFi), there is a necessity to make use of a fast 100 Mbps service so that the connection would have sufficient bandwidth to meet the needs of the store and customers.

Therefore, the correct answer is Option B

Read more here:

https://brainly.com/question/18450917

camera mount that is worn over the shoulders of a camera operator. What is it called?

Answers

It is called a camera stabilizer.
I hope this helped :)

What is the best data type for traveling day?

Answers

here if its wrong sorry

Your company is building a new architecture to support its data-centric business focus. You are responsible for setting up the network. Your company's mobile and web-facing applications will be deployed on-premises, and all data analysis will be conducted in GCP. The plan is to process and load 7 years of archived .csv files totaling 900 TB of data and then continue loading 10 TB of data daily. You currently have an existing 100-MB internet connection. What actions will meet your company's needs

Answers

The actions will meet your company's needs is to Lease a Transfer Appliance, upload archived files to it, and send it to oogle to transfer archived data to Cloud Storage.

Data centric is simply known to be an architecture where data is said to be of primary and permanent asset, and applications is temporary.

Businesses is all about functionality, and as such, firms often buys or build application systems.

Each application system is known to have its own unique data model, and its code is often linked with the data model used.

Conclusively, Transferring large datasets needs manpower that is the right team, planning early, and testing your transfer plan before its use.

 

Learn more data-centric business from

https://brainly.com/question/21810261

Leon wants an output from his tablet. What should he look at? A. the memory chip B. the processor C. the screen D. the power button

Answers

Answer:

he should look at the screen

Answer:

C. The screen

Explanation:

got it on edge

Other Questions
One of the Temples in the Horyu-ji Area 2) What religion is this temple from? Can I please get help What is 2x-3 when x=5 Which of the following was true of hunters and gatherers please help me answer this question! handwashing with regular soap is effective because __________. A particle is constrained to move round a circle radius 382400km and makes a single revolution in 27.3 days. (i). Find the velocity in ms-1. (ii). Find its acceleration As a game designer, your goal in game design is to get your players to fell like your game is the whole world. You want your players to obtain a state of deep engagement with the game that allows them to fully invest their imagination in the game's artificial world. If you successfully accomplish this, what have you mastered?roguelike statesecond person perspective player immersion seamless movement reusable containers provided by an operation for take-home food must be true or false the contraction of a muscle may be either shortening or lengthening of the muscle Although computers have become highly advanced, they are not yet able to understand the nuances of expression and gesture like a human artist can. How might this change PLEASE HELP! IT'S DUE TODAY!!! How did Poisonous Gas connect to Industrial Revolution? 2-3 sentences. i need serious answers ppl keep putting those links How have things changed since your childhood? In 3 different scenarios, tell something that you did this year compared to something that you did a lot as a child. Example: Este ao celebr la Navidad en Nueva York, pero cuando era nia, celebraba la Navidad con mi familia en California. Which of the following is NOT a function of a Web Browser?O Provide a platform that users can use to access web pages and sitesO Access a Web server and request a page on the Internet so the right information shows upO Crawl through the World Wide Web searching for words and terms to index in Web DatabasesO Interpret Web page's HTML tags and display the Web page's information in a way that is intended/easily readable for you Whats 1 + 1 many half a window What are the advantages and/or disadvantages of the radiation that technology has had for the human economy? In a game, you toss a fair coin and a fair six-sided die. If you toss a heads on the coin and roll either a 3 or a 6 on the die, you win $30. Otherwise, you lose $6. What is the expected profit of one round of this game? Someone plz help me :( Which is the correct factored form for 8x^3?