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]
3 years ago
13

Consider the following method.

Computers and Technology
1 answer:
Akimi4 [234]3 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
An Administrator wants to have a thank you email sent after the form on the "Request a Demo" landing page is submitted. Where ca
sweet [91]

Answer:

Answer D is correct :

Explanation:

Configure an autoresponder email to send as a completion action when the \Request a Demo\ form has been submitted.

6 0
3 years ago
in python Write a program that prompts the user to enter a hex character and displays its corresponding decimal integer python
Archy [21]

Answer:

Here is some that I know. The code is below:

#accepting input hex_num=input() #checking if it is a number if(hex_num>='0' and hex_num<='9'):     #printing that number     print(hex_num) #checking

Explanation:

I hope this helps

8 0
3 years ago
You have found statistics on the Internet that you would like to use in your speech.
miss Akunina [59]

Answer:

You cite them correctly and that the statistics are real.

Explanation:

5 0
3 years ago
Write the Flowchart to find Even number between 1 to 50<br>​
ASHA 777 [7]

Answer:

See attachment for flowchart

Explanation:

Required

Flowchart to fine even from 1 to 50

The flowchart has been attached.

The rough algorithm (explanation) of the flowchart is as follows.

1. Start

2. Initialize num to 1

3. Check if num is less than or equal to 50

  3.1 If yes

      3.1.1 Check if num is even

      3.1.1.1 If yes

         3.1.1.2 Print num

  3.1.3 Increase num by 1

 3.2 If num is greater than 50

    3.2.1 Stop

4. Goto 3

4 0
3 years ago
What is meaning of reboot
TEA [102]
I believe to reboot is to reset. Its the act of resetting, or starting up a computer again.
4 0
4 years ago
Read 2 more answers
Other questions:
  • Which cisco ios command is used to display the current ospf neighbors and their rids?
    11·1 answer
  • 11. The golden rule of safe driving is: A. Always drive at the posted speed limit B. Never drive while physically or mentally im
    6·1 answer
  • When you write a C# program that stores a value in a variable, you are using temporary storage; the value you store is lost when
    12·1 answer
  • A student is curious about how a Web site appears on his computer screen. On a piece of paper,
    9·1 answer
  • A friend asks you for help writing a computer program to calculate the square yards of carpet needed for a dorm room. The statem
    15·1 answer
  • What is string literal in Java?
    5·1 answer
  • Accenture has put together a coalition of several ecosystem partners to implement the principles of blockchain and Multi-party S
    5·1 answer
  • PLS HELP SOON
    15·1 answer
  • Arrange the computers in the order fastest to slowest: Minicomputer, Supercomputer, Personal Computer and Mainframe.
    9·1 answer
  • a user complains he cannot access a particular website, although he is able to access other websites. At which layer of the OSI
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!