Q1. Write the output for the following code segments. Attach a screenshot for your output. # Output [01 Mark] } Code import java.util."; class Arraylist { public static void main(String args[]) { ArrayList obj = new ArrayList(); obj.add("A"); obj.add("B"); obj.add("C"); obj.add(2, "D"); System.out.println(obj); } class array_output { public static void main(String args[]) { int array_variable [] = new int[10]; for (int i = 0; i < 10; ++i) { array_variable = 1; System.out.print(array_variable i++; } [01 Mark] > } [01 Mark] class A { public int i; public int ); AC) { i = 1; j = 2;
class B extends A { int a; B) { super(); } } class super_use { public static void main(String args[]) { B obj - new B(); System.out.println(obj.i + "." + obj.1); } } [01 Mark] | super. i) class A { public int i; private int j; } class B extends A { void display) { super.j = super.i + 1; System.out.println(super.i + ; } class inheritance { public static void main(String args[]) { B obj = new BO); obj.i=1; obj.1-2; obj.display(); ) }
Q1. Write the output for the following code segments. Attach a screenshot for your output. # Output [01 Mark] } Code imp
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Q1. Write the output for the following code segments. Attach a screenshot for your output. # Output [01 Mark] } Code imp
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!