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
Rus_ich [418]
4 years ago
13

In Java, it is not possible for a method to call itself? (true,false)

Computers and Technology
1 answer:
IgorC [24]4 years ago
4 0

Answer:

false

Explanation:

You could just call a method itself and just have a condition to get out. For example an recursive method with a base case.

You might be interested in
What service provides realtime delivery of voice or streaming media?
k0ka [10]
YouTube, Twitch, and Beam are media that you can stream on.
(If that's what you are looking for.)
8 0
4 years ago
What does the green light mean?<br>And does it have a red light?
Rom4ik [11]
Green light usally mean its charged and red means its dead
5 0
3 years ago
Read 2 more answers
What formula would you enter in C3 that combines A3 and B3 to get a result like in C2? =CONCATENATE("A3","","B3") =CONCATENATE(A
Vanyuwa [196]

Answer:

Option B, =CONCATENATE(A3," ",B3)

Explanation:

CONCATENATE function is used to join two or more strings together. The syntax for CONCATENATE function in Microsoft Excel is:

CONCATENATE( text1, [ text2, ... text_n ] )

Where, ext1, text2, ... text_n represents the strings that are to be joined together.  

CONCATENATE(A2," ",B2)

The above syntax is used when space is to be entered between two string values

Hence, option B is correct

7 0
3 years ago
It is a well-researched fact that men in a restroom generally prefer to maximizetheir distance from already occupied stalls, by
Artyom0805 [142]

Answer:

The code below addresses the problem statement with appropriate comments for explanation.

Explanation:

public class Stall

{

public static void main(String[] args)

{

boolean[] arr = new boolean[10];

while(hasFreeSpots(arr))   // as long as there is a free slot

{

arr[position(arr)] = true;  

// position(arr) gets the position of slot a person would most likely enter at(view problem statement)

// setting that position true(position occupied) by arr[position(arr)]

System.out.println(stallView(arr));   // printing current state of the stall using 'X' and '_'

}

}

/**

* Find the empty position that is in the middle of the sub-array of largest group of empty spots

* @param arr an array of boolean values

* @return returns an an integer value. Optimal position to be occupied.

*/

public static int position(boolean[] arr)

{

int first = 0;   // first stores the starting position of "longest sequence of unoccupied places"

int last = 0;   // last stores the ending position of "longest sequence of unoccupied places"

int temp1 = 0;   // temp1 stores the starting position of "current sequence of unoccupied places"

int temp2 = 0; // temp2 stores the ending position of "current sequence of unoccupied places"

 

for(int i = 0; i < arr.length; i++)   // for each slot in the Stall

{    

if(!arr[i]) // if slot i is not occupied

{    

temp1 = i;   // store starting position of "current sequence of unoccupied places" in temp1

while(i < arr.length && !arr[i] )   // if i is a valid index and as long as this slot is not occupied increment i

{

i++;

}

// we break out of the loop either if i is invalid index(reached end of the array)

// or if the slot is occupied by a person already

temp2 = i;   // store ending position of "current sequence of unoccupied places" in temp2

if(Math.abs(first - last) < Math.abs(temp1 - temp2))

  // if current sequence is longer than longest sequence, update it

{

first = temp1;

last = temp2;    

}

}

}

return (first + last) / 2;   // return middle index of first and last

}

/**

* Checks if there are empty spots in an array, basically checks if there is a false boolean value

* thats representing an empty spot in an array

* @param arr the input array, of boolean values

* @return returns a boolean value, true if there are false elements inside the array

*/

public static boolean hasFreeSpots(boolean[] arr)

{

boolean rtn = true;   // initializing rtn to 'true'

for(int i = 0; i < arr.length; i++)   // for every slot in the Stall

{

if(!arr[i]){rtn = false;}   // sets rtn to false if a free spot found

}

return !rtn;   // returns true if a free spot found and returns false if no free spot found

}

/**

* X for true, _ for false. Representing occupied(X) and free stalls(_)

* @param arr a boolean array

* @return returns a string representation if the input

*/

public static String stallView(boolean[] arr)

{

String str = "";       // initializing str to be an empty String

for(int i = 0; i < arr.length; i++)   // for every slot in Stall

{

if(arr[i]){str += " X";}   // Add X to str if slot is occupied

else {str += " _";}           // prints _ to str if slot not occupied

}

return str;       // return str(pictorial representation of Stall with 'X', '_')

}

}

7 0
3 years ago
What is cloud computing,the wireless revolution,and IoT
Crazy boy [7]

Cloud Computing in IoT works as part of a collaboration and is used to store IoT data. The Cloud is a centralised server containing computer resources that can be accessed whenever required. Cloud Computing is an easy travel method for the large data packages generated by the IoT through the Internet.

7 0
2 years ago
Other questions:
  • The disk drive is a secondary storage device that stores data by _____ encoding it onto a spinning circular disk.
    14·1 answer
  • What is the file extension for an impress file??
    10·1 answer
  • Which term describes an event where a person who does not have the required clearance or access caveats comes into possession of
    15·2 answers
  • Which of the following are examples of how a company might use consumer data it had collected? a To decide what types of product
    10·1 answer
  • Write the difference between:
    14·2 answers
  • 28. Which major NIMS Component describes recommended organizational structures for incident management at the operational and in
    10·1 answer
  • Select the parts of a business letter.
    6·2 answers
  • Adios brainly, you were sh.t sometimes, but you had your moments, wont be posting that much take my points away i d c
    6·2 answers
  • David plays racing games on his way to work. He uses the analog stick to navigate his vehicle through other artificial intellige
    7·2 answers
  • My assignment asks me to write a python program using if, elif, and else that takes a user's salary and calculates the tax based
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!