What do you want to save?
Add Code snippet
New code examples
-
Java 2022-02-04 18:05:24
java pass array as method parameter
/* In java, you can create an array like this: new int[]{1, 2, 3}; replace `int` with whatever you want */ public static void doSomething(int[] list) { System.out.println("Something is done."); } public static void main(String[] args) { ... Add solution -
Javascript 2022-01-31 02:42:27
RangeError
//Occurs when passing an invalid value to a function. let nums = Array(-1); /*The constructor function Array(n) creates an empty array of length n. It is not possible to create an array with negative length, so the code results in RangeError: Invalid ... Add solution -
Java 2021-11-11 06:27:10
how to put a string in an array parameter java
public class Test { public static void main(String[] args) { // Declare a constant value for the number of lockers final int NUMBER_OF_LOCKER = 100; // Create an array to store the status of each array // The first student closed all lo... Add solution -
PHP 2021-11-04 20:53:20
PHP copy table from one database to another
// Create a new MySQL database connection if (!$con = new mysqli('localhost', $username, $password, $database)) { die('An error occurred while connecting to the MySQL server!<br><br>' . $con->connect_error); } // Create an array of MyS... Add solution -
C# 2021-11-03 13:37:16
c# reflection create generic type
Type generic = typeof(Dictionary<,>); // Create an array of types to substitute for the type parameters of Dictionary. The key is of type string, and the type to be contained in the Dictionary is Test. Type[] typeArgs = { typeof(string), typeof(Tes... Add solution -
TypeScript 2021-11-02 22:56:13
how push objects into a local stotage array
// Get the existing data var existing = localStorage.getItem('myFavoriteSandwich'); // If no existing data, create an array // Otherwise, convert the localStorage string to an array existing = existing ? existing.split(',') : []; // Add new data to loca... Add solution
Best helpers
Ranking is empty