Skip to content

Instantly share code, notes, and snippets.

View sshehrozali's full-sized avatar
🌍

Shehroz Ali sshehrozali

🌍
View GitHub Profile
@sshehrozali
sshehrozali / arrays.java
Created April 18, 2023 17:19
Working with Arrays in Java
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
// Q. Take 5 integer inputs from user and store them in an array and print them on screen.
// Created an array of Integers
ArrayList<Integer> numbers = new ArrayList<>();
// Stored data in array
@sshehrozali
sshehrozali / extendingArray.java
Created May 17, 2023 16:44
Java code to (mimic) extending the array (v1)
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) {
// Q.
// Take 10 integer inputs from user and store them in
// an array. Now, copy all the elements in
// an another array but in reverse order.