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
Lelechka [254]
3 years ago
5

Is brainly bugging out rn? The site isnt like loading completely

Computers and Technology
1 answer:
yuradex [85]3 years ago
3 0
Yes it is mines isn’t working either
You might be interested in
Create a method called nicknames that passes an array as a parameter. Inside the method initialize it to hold 5 names of your ch
Gre4nikov [31]
<h2>Answer:</h2>

    //======METHOD DECLARATION=========//          

    //method name: nicknames                                          

    //method return type: void                                            

    //method parameter: an array reference                    

    public static void nicknames(String [] names){      

       //initialize the array with 5 random names              

       names = new String[] {"John", "Doe", "Brian", "Loveth", "Chris"};

       //using an enhanced for loop, print out the elements in the array

       for(String n: names){

           System.out.print(n + " ");

       }

       

    }

<h2>Explanation:</h2>

The program is written in Java. It contains comments explaining important parts of the code. Kindly go through these comments.

A few things to note.

i. Since the method does not return any value, its return type is <em>void</em>

ii. The method is made public so that it can be accessible anywhere in and out of the class the uses it.

iii. The method is made static since it will most probably be called in the static main method (at least for testing in this case)

iv. The method receives an array of type <em>String </em>as parameter since the names to be stored are of type <em>String</em>.

v. The format of initializing an array manually should follow as shown on line 7. The <em>new</em> keyword followed by the array type (String), followed by the square brackets ([]) are all important.

vi. An enhanced for loop (lines 9 - 11) is a shorthand way of writing a for loop. The format is as follows;

=> The keyword <em>for</em>

=> followed by an opening parenthesis

=> followed by the type of each of the elements in the array. Type String in this case.

=> followed by a variable name. This holds an element per cycle of the loop.

=> followed by a column

=> followed by the array

=> followed by the closing parenthesis.

=> followed by a pair of curly parentheses serving as a block containing the  code to be executed in every cycle of the loop. In this case, the array elements, each held in turn by variable n, will be printed followed by a space.

A complete code and sample output for testing purposes are shown as follows:

==================================================

public class Tester{

    //The main method

    public static void main(String []args){

       

       String [] names = new String[5];

       nicknames(names);

    }

   

  //The nicknames method

    public static void nicknames(String [] names){

       names = new String[] {"John", "Doe", "Brian", "Loveth", "Chris"};

       for(String n: names){

           System.out.print(n + " ");

       }

       

    }

}

==================================================

<h2>Output:</h2>

John Doe Brian Loveth Chris

<em>NB: To run this program, copy the complete code, paste in an IDE or editor and save as Tester.java</em>

6 0
3 years ago
What does Falstaff do to protect himself in battle? ​
notka56 [123]
Bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark
3 0
3 years ago
Unchecked exceptions require you surround the code that might throw such an exception with a try block or you must use a throws
hammer [34]

Answer:

b. False

Explanation:

False, unchecked exceptions do not cause compilation errors and do not require try/catch blocks or throws statements. However, although they are not required it is good programming to include them in order to handle any exceptions that may arise. If you do not include a proper way to handle such an exception the program will still run but may run into an exception during runtime. If this occurs then the entire program will crash because it does not know how to handle the exception since you did not provide instructions for such a scenario.

6 0
3 years ago
What type of information is appropriate for headers and footers? Check all that apply.
lbvjy [14]

Answer:

slide/page number

smart art

maybe date and time

Explanation:

6 0
3 years ago
Read 2 more answers
¿cuales son la diferencias de programacion estructurada y programacion orientada a objetos?
Arturiano [62]

Answer:

La programación estructurada está diseñada para enfocarse en el proceso / estructura lógica y luego en los datos requeridos para ese proceso. La programación orientada a objetos está diseñada para centrarse en los datos. ... La programación orientada a objetos admite herencia, encapsulación, abstracción, polimorfismo

Explanation:

5 0
3 years ago
Other questions:
  • How can I get a refund of my money back
    12·2 answers
  • The function takes two string parameters; the first is the name of a file and the second is text. Complete the function to appen
    7·1 answer
  • And computers are the most commonly seen microcomputers.
    10·1 answer
  • What is 1/2 minus 1/16?
    7·2 answers
  • You have installed five new 300 GB disk drives into a server running Windows Server 2012. You want to create a volume that will
    15·1 answer
  • _An electronic device used for processing data.
    10·2 answers
  • What is the purpose of interrupts? How does an interrupt differ from a trap? Can traps be generated intentionally by a user prog
    11·1 answer
  • In this chapter, you subnetted a Class C private network into six subnets. In this project, you work with a Class B private netw
    10·1 answer
  • Look at (d), is it accurate? ​
    9·2 answers
  • All the following are the basis of the World Wide Web except:
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!