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
umka2103 [35]
3 years ago
7

When defining a class, it is a best practice to declare ____ as private. constructors mutators nothing should be private accesso

rs variables
Computers and Technology
1 answer:
katrin [286]3 years ago
6 0

Answer:

The answer is "variables".

Explanation:

It is necessary to declare a variable privately when declaring a class because the private variable 'protects' the code while it is in operation. It may not aim to protect it at this stage from changing the codes themselves for other developers. Its purpose of the so-called "data hiding" is to hold the internal data from many other classes using the class protected.

You might be interested in
We are building a word processor and we would like to implement a "reflow" functionality that full-justifies text.Given a maximu
adoni [48]

Answer:

The code is given below in Java with appropriate comments

Explanation:

Reflow is an function which helps you to justify your functionality

You need to input a string array and the max width and you will get the

output in a list(string).

public List<String> Reflow(String[] input, int width) {

   List<String> result = new ArrayList<String>();

 

   if(input==null || input.length==0){

       return result;

   }

 

 

   int count=0;

   int last=0;

   ArrayList<String> list = new ArrayList<String>();

   for(int i=0; i<input.length; i++){

       count = count + input[i].length();

 

       if(count+i-last>width){

           int wl = count-input[i].length();

           int sl = maxWidth-wl;

           int each = 1;

           int el = 0;

 

           if(i-last-1>0){

               each = sl/(i-last-1);

               el = sl%(i-last-1);

           }

 

           StringBuilder sb = new StringBuilder();

 

           for(int k=last; k<i-1; k++){

               sb.append(input[k]);

 

               int ce = 0;

               while(ce<each){

                   sb.append(" ");

                   ce++;

               }

 

               if(el>0){

                   sb.append(" ");

                   el--;

               }

           }

 

           sb.append(input[i-1]);//last input in the line

           //if only one word in this line, need to fill left with space

           while(sb.length()<width){

               sb.append(" ");

           }

 

           result.add(sb.toString());

 

           last = i;

           count=input[i].length();

       }

   }

 

   int lastLen = 0;

   StringBuilder sb = new StringBuilder();

 

   for(int i=last; i<input.length-1; i++){

       count = count+input[i].length();

       sb.append(input[i]+" ");

   }

 

   sb.append(input[input.length-1]);

   int d=0;

   while(sb.length()<maxWidth){

       sb.append(" ");

   }

   result.add(sb.toString());

 

   return result;

}

6 0
3 years ago
You are a project manager tasked to implement a critical application in a reputed bank. A client review indicates that you could
Basile [38]
A. diligence in service
6 0
2 years ago
Read 2 more answers
Which of the following statements is the least abstraction of the world wide web
Sliva [168]
<span>Documents, images and other data you can access by providing a uniform Resource Locator. URL - the Web Address

I hope this helps. You didn't give me the choices to from.  </span>
8 0
3 years ago
Read 2 more answers
Alexi is writing a program which prompts users to enter their race times without decimals. Which function should she use?
Juli2301 [7.4K]

Answer:

It's either B or C

Explanation:

I saw this on another brainly but they said it wasn't print so id say b is most likely

6 0
2 years ago
Read 2 more answers
If you store a binary tree in an array the index of the right child and the left child is computed by _______
Fiesta28 [93]

Answer:

left child = 2 index +1 & right child = 2 index + 2

Please Mark Brainliest If This Helped!

3 0
2 years ago
Other questions:
  • Businesses sometimes achieve uninterruptible service by using a technology known as ____ to keep a mirror copy of all their data
    11·1 answer
  • Computer virus is a<br> a. software<br> b. hardware<br> c. bacteria<br> d. none of these
    13·1 answer
  • How do governments correct for negative externalities?
    5·1 answer
  • From Blown to Bits why is it important to know what children are doing on the Web Tonight?
    7·1 answer
  • How can injection attacks be prevented? Check all that apply
    6·2 answers
  • PLS HELP ILL GIVE BRAINLY- (enter the answer) Microsoft _________ is an example of a desktop publishing software
    13·2 answers
  • 2. Used to drive in or remove screws that fasten electrical wires or other electrical accessories. A. Pliers C. Screwdrivers B.
    15·1 answer
  • What reforms were made by the British government in India after the war of independence? write any three
    5·1 answer
  • JAVA<br>plzz help...............​
    7·1 answer
  • List 10 examples of computer ethics<br>(please give even 1 if you can, I need it urgently) ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!