import java.util.Scanner;
class array
{
public static void main(String args[]) { Scanner s=new Scanner(System.in); System.out.print("enter the no:->"); int []arr=new int[5]; int []arr=s.nextInt(); System.out.println(arr); }
}
Suspending Functions Suspending functions are a cornerstone of Kotlin Coroutines. They are the functions that can be paused and resumed at a later time. To define a suspending function, you use the suspend modifier. Here's a simple example: import kotlinx.coroutines.* suspend fun doSomething () { delay( 1000L ) println( "Doing something" ) } fun main () = runBlocking { launch { doSomething() } } In this code, doSomething is a suspending function. Inside doSomething , we're delaying for one second and then printing a message. We're calling doSomething from a coroutine, because suspending functions can only be called from another suspending function or a coroutine.