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 office is facing a network issue. The technicians have determined that a virus affected the manager's computer. However, they
Margarita [4]

Answer:

The correct answer is: Bus Topology.

Explanation:

Bus Topology is a network setup where all the computers are connected to a single cable. Servers can connect easily to the network but it implies everyone connected has access to what everybody in the same network is doing. Security options are limited to no-existent under this topology.

In that case, if technicians cannot isolate a virus infection problem, it is the result of working with a bus topology where more than one computer is connected to the same network and every terminal has access to each terminal.

7 0
3 years ago
2. Add a _______ to manually force text from one page to the next page. A. footer B. page break C. blank page D. header
Morgarella [4.7K]
The answer is: b) page break. 
5 0
3 years ago
Read 2 more answers
Choose the true statement below. Question 8 options: A) The content that displays in the browser is contained in the head sectio
Rzqust [24]

Answer:

a. The content that displays in the browser is contained in the head section.

5 0
3 years ago
How to get an object from a container in java.
Vinil7 [7]
If it stores any type of objects mixed, use Object as storage class. All classes inherit from Object and for primitives use their respective wrapper classes. Or just use one of the bazillion container classes that already exist.
3 0
3 years ago
Your friend really likes talking about owls. Write a function owl_count that takes a block of text and counts how many words the
andriy [413]
Text = “ I really like owls. Did you know that an owls eyes are more than twice as big as the eyes of other birds of comparable weight? And that when an owl partially closes its eyes during the day, it is just blocking out light? Sometimes I wish I could be an owl.

word = ‘owl’
texts = text.lower()
owlist = list(texts.split())
count = text.count(word)
num = [owlist, count] #num has no meaning just random var
print(num)


Alter in anyway you want so that you can succeed. ✌
4 0
3 years ago
Other questions:
  • Which cloud computing service model gives software developers access to multiple operating systems for testing?
    5·1 answer
  • _____________ is a service that provides access to hardware resources available over the Internet.
    11·1 answer
  • Does anyone watch The Office?
    14·1 answer
  • How does a hard drive work?
    5·1 answer
  • What are the best data structures to create the following items? And why?
    13·1 answer
  • You are the administrator of the Sybex website. You are working when suddenly web server and network utilization spikes to 100 p
    15·1 answer
  • Write a function called show_info that takes a name, a home city, and a home state (a total of 3 arguments) and returns a full s
    12·1 answer
  • ______The statement #include < math.h > defines the name of the current program you are writing as "math". (T/F)
    10·2 answers
  • The people on this platform are unbelievably nice. its almost rare to see this type of kindness online these days. Just wanted t
    14·1 answer
  • A write the result P*=++j where j is 24
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!