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
vodka [1.7K]
2 years ago
13

Consider the following method.

Computers and Technology
1 answer:
Akimi4 [234]2 years ago
3 0

Answer:

The output of the given code as follows:

Program:

public class Main //define class

{

   public static void printSomething (int num, boolean val) //define method.

{

   num--; //decrease value by 1.

   System.out.print(val); //print value.

   System.out.print(num); //print value.

   

}

public static void main(String[] args) //main method

{

   printSomething(1, true); //calling function

   printSomething(2, true); //calling function

}

}

Output:

true 0

true 1

Explanation:

In the question, it is given there is a method that is "printSomething" is defined. This method accepts two parameters that are num and val. where num is an integer variable and val is boolean variable that holds two values only that are true or false. inside the method, we decrease the value of the num variable by 1 and then we print the value of val and num variable. This function does not return any value because we use return type void.

The function is defined in the same class so, we call the function two times that can be described as:

  • In first time calling we pass 1 and true value in function so it will "print true 0".
  • In second time calling we pass 2 and true value in function so it will "print true 1".

You might be interested in
Commands are organized into tabs on the
natita [175]
A. Ribbon just took the test
5 0
2 years ago
Read 2 more answers
Does Windows 7 support secure boot in UEFI? Windows eight? Linux UBUNTU version 14?
Anni [7]
Yes, windows 7 does support secure boot in UEFI. UEFI allows for backward compatibility. IT can boot a MBR hard drive and provides a BIOS boot through its Compatibility Support Module (CSM) feature.
4 0
3 years ago
Assuming that we only support BEQ and ADD instructions, discuss how changes in the given latency of this resource affect the cyc
sertanlavr [38]

Answer:

Refer below.

Explanation:

Because we are inserting commands to beq, we will need an execution of the ALU, and then a register write. This result in and increase cycle time of the PC relative branch:

440+90=530ps.

As it is the longest time to execute, so its a critical path

6 0
2 years ago
What new information, strategies, or techniques have you learned that will increase your technology skills? Explain why its impo
Minchanka [31]

Taking brakes every hour so your eyes don't start to strain.

6 0
3 years ago
Write a two to three sentence response to the following question:
nlexa [21]

Answer:

Functions can be useful for many reasons, it is one of the main components to learn in writing code. Without functions code would not be where it is today.

Explanation:

5 0
2 years ago
Other questions:
  • you are a software engineering consultant and have been called in by the vice president of finance of a corporation that manufac
    10·1 answer
  • I don’t know technically
    9·2 answers
  • What was one of the first inventions that made it possible to communicate almost instantly?
    11·1 answer
  • _____ are independent and not associated with the marketing efforts of any particular company or brand.​
    9·1 answer
  • An online service allows users to integrate their phonebook with their social media profiles and stores it on the cloud. The pho
    12·1 answer
  • Why is population composition by age important give reason​
    13·1 answer
  • The printer prints 16 pages every minute. How many pages are printed in 6 minutes?
    14·2 answers
  • How does social network use message to entertain?
    14·1 answer
  • Look at the picture ​
    13·2 answers
  • What was the name of the first computer, developed by charles babbage?.
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!