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
Writers in our networked world enhance their credibility by
yaroslaw [1]

Answer:

b

Explanation:

5 0
3 years ago
Which file type is the best choice if the image will be made into a billboard?
matrenka [14]

Answer:

BMP

Explanation:

They are high resolution and are suitable for billboards.

6 0
1 year ago
Amy wants to make an exact replica of a specific area in an image. Which tool Amy will use?
ipn [44]

Answer:

Explanation:

.

4 0
3 years ago
Ryan would like to copy a list of contacts from a colleague into his personal address book. The list of contacts is
Colt1911 [192]

Answer:

He should: Format the text file with comma-separated values and save as CSV file type. ]

Explanation:

hope this helps!

5 0
3 years ago
Write a recursive method called lengthOfLongestSubsequence(a, b) that calculates the length of the longest common subsequence (l
kompoz [17]

Answer:

Explanation:

The following code is written in Java and creates the recursive function to find the longest common substring as requested.

 static int lengthOfLongestSubsequence(String X, String Y) {

       int m = X.length();

       int n = Y.length();

       if (m == 0 || n == 0) {

           return 0;

       }

       if (X.charAt(m - 1) == Y.charAt(n - 1)) {

           return 1 + lengthOfLongestSubsequence(X, Y);

       } else {

           return Math.max(lengthOfLongestSubsequence(X, Y),

                   lengthOfLongestSubsequence(X, Y));

       }

   }

4 0
3 years ago
Other questions:
  • Which of the following was one of the first internet search engines? A. archie B. google C. Yahoo D.ask
    7·1 answer
  • A nonpipelined system takes 300ns to process a task. The same task can be processed in a 5-segment pipeline with a clock cycle o
    10·1 answer
  • Which of the following is the correct order of the SDLC?
    14·1 answer
  • The trigonometry book says: sin^2(t) + cos^2(t) = 1 Write a Python program that verifies the formula with the help of the Python
    11·1 answer
  • Your desktop, internet explorer, and the media player can be started from this area on most computers
    9·1 answer
  • PLS ANSWER ASAP!
    9·1 answer
  • Front and rear camber and toe settings are being adjusted during a four-wheel alignment. The correct order for performing these
    13·1 answer
  • 4
    12·2 answers
  • Who Likes K-pop? Which group or groups do you like
    12·2 answers
  • The following statements regarding centralized administration concepts are presented to you in an interview in which only one of
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!