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
Which of the following is not a common input device?
Debora [2.8K]

The device which provides any piece of information from a computer into human-readable form is known as the Output device.

Explanation:

3 0
3 years ago
A Ground Fault Circuit Interrupter (GFCI) works by comparing the amount of current going to and returning from equipment along t
Shtirlitz [24]

As the name states, during a ground-fault (when the current going out is significantly different than the current going in) the GCFI interupts the current.  Usually by a switch of some sort.  (Pushing the "test" button produces that click, and cuts off the current)

7 0
4 years ago
Read 2 more answers
1.6.1: Identifier validator. Check if the following identifiers are valid: c, cat, n1m1, short1, _hello, 42c, hi there, and cat!
pogonyaev

Answer:

correct option c, cat, n1m1, short1,

Explanation:

correct option c, cat, n1m1, short1,

The variable is used to store the value of the value varies during the program execution...

some of the basic rules of identifier

  • The variable must be started with the alphabet  
  • We cannot declare the variable name as keyword i.e "that value is already defined and in the compiler"
  • Variable-length does not exceed 8 characters  
  • We cannot use space to declared any variable
  • _hello,42C, hi there and cat! are not follow the basic rule of identifier so they are not identifier validator
5 0
4 years ago
What do you think we'll be able to do with computers in 10 years?
almond37 [142]

we would be able to put it in our pockets


6 0
3 years ago
Limestone deposits indicate that the location was:
jek_recluse [69]
B: formed by an active volcano
8 0
4 years ago
Other questions:
  • What most distinguishes projects with a strong need for computer animation from projects without such a strong need?
    8·1 answer
  • How do you use the Internet? Think about your typical day. When are you using the Internet? For what purposes? What role does it
    11·1 answer
  • Which of the following is similar to defense in depth and supports multiple layers of security?a. Defense in depthb. Diversity o
    7·1 answer
  • There are only three active stations in a slotted aloha network: a, b, and
    6·1 answer
  • Describe the effects technology, particularly computers, has had on mechanical labor.
    8·1 answer
  • Types of antivirus explain them
    9·1 answer
  • PLEASE HELP ASAP!!! Prompt<br> What is the Bcc address field for?
    7·1 answer
  • What methods do phishing and spoofing scammers use? List and explain methods to protect against phishing and spoofing scams.
    14·1 answer
  • What is bespoke software???​
    9·2 answers
  • Which requires large computer memory?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!