package arrays;

 

public class ArrayDefinition {

    public static void main(String[] args) {

        int[] nums = {3,6,33,1,4,5,78,6,5,9};

        System.out.println(nums[8]);

        System.out.println(nums.length);

    }

}

 

 

package arrays;

public class MultiArrayDefinition {

    public static void main(String[] args) {

        int[][] nums = {{1,2,3},{4,5,6},{7,8,9}};

        System.out.println(nums[1][2]);        

     }

}

 

 

 

package arrays;

public class MultiArrayDefinition2 {

    public static void main(String[] args) {

        int[][] nums = new int[3][3];

        nums[1][2] = 6;

        System.out.println(nums[1][2]);        

    }

}

 

 

 

package arrays;

import java.util.Arrays;

 

public class ArraysHelper {

    public static void main(String[] args) {

        int[] nums = {3,1,5,3,7,5,8};

        System.out.println(Arrays.binarySearch(nums, 8));

        Arrays.sort(nums);

        System.out.println(Arrays.toString(nums));         

    }

}

 

 

 

package strings;

public class Strings {

    public static void main(String[] args) {

        String s1 = "Hello World";

        System.out.println(s1.toUpperCase());

        System.out.println(s1.substring(6));

        System.out.println(s1.indexOf("W"));

    }

}

 

 

 

 

package strings;

public class StringBuilder {

    public static void main(String[] args) {

        StringBuilder sb1 = new StringBuilder ("Hello");

        sb1.append(" World!!!");

        sb1.reverse();

        System.out.println(sb1);

    }

}