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
Speech on inventors and inventions
vlada-n [284]
Interntors present an interesting kind of people who think in peculiar ways sometimes. This ability allows them to view certain situations in ways in which other people cannot. Because of this, they can think of new ways of how such situations can be tackled. This is how inventions are born. A person with an inventive mind sees a new situation where he thinks of a new solution how he could improve this situation with his invention.

This process is continued continuously with new generations of inventors seeing and coming back to old situations over and over again, inventing new things along the way. 
4 0
3 years ago
Which asynchronous electronic community is also known as a forum?
Semmy [17]
What are the choices?
Message Boarding is the asynchronous electronic that is know as a forum.
3 0
3 years ago
Read 2 more answers
How do i fix my this??
maksim [4K]

get a new monitor u cant


6 0
3 years ago
Read 2 more answers
A firm has a huge amount of individual customer data saved in different databases. Which of the following can be used to integra
Rama09 [41]

Answer:

C. CMR systems

Explanation:

CMR or customer relationship management is a strategy that uses data analysis of customers to manage the interaction between a company and current and potential customers.

It analyses the data of client from different channels like wesites, email, social media,telephone log etc, describing and predicting potential decisions to be made to enhance customer service and acquisition.

6 0
2 years ago
Instant messaging is commonly referred to as
melomori [17]
Chat, IM, in real-time
7 0
3 years ago
Other questions:
  • What operating system allows various teams in its office to network and collaborate on projects
    5·1 answer
  • Cari brought 2 pounds of grapes at the grocery store she ate 5 ounces of the grapes on way home what is the weight of the grapes
    12·1 answer
  • File Explorer contains ribbon tabs that can be used for various functions. Which ribbon tab provides options to open a new File
    11·1 answer
  • Which of the following information would best be displayed throughout the use of a time line
    11·1 answer
  • Assume we are testing a variable is_sunny in a while loop. is_sunny = “n”.
    13·1 answer
  • Examine the exhibit above. "Device A" is an 8-port layer 2 managed switch and "Device C" is a 4-port hub. Which of the following
    13·1 answer
  • The loop function is similar to range(), but handles the parameters somewhat differently: it takes in 3 parameters: the starting
    14·1 answer
  • Write a valid HTML + Python page that will count numbered from 1 to 1,000,000?​
    9·1 answer
  • Is this App for real?​
    5·1 answer
  • Please help ASAP!
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!