Page 1 of 1

these are java program... note that-write the output of these code without running the code and explain... I need the an

Posted: Mon Jun 06, 2022 5:42 pm
by answerhappygod
these are java program... note that-write the output of these code without running the code and explain... I need the answer within 25 minutes...it’s very urgent.
These Are Java Program Note That Write The Output Of These Code Without Running The Code And Explain I Need The An 1
These Are Java Program Note That Write The Output Of These Code Without Running The Code And Explain I Need The An 1 (37.64 KiB) Viewed 32 times
These Are Java Program Note That Write The Output Of These Code Without Running The Code And Explain I Need The An 2
These Are Java Program Note That Write The Output Of These Code Without Running The Code And Explain I Need The An 2 (41.92 KiB) Viewed 32 times
a) class StaticTest { static int x = 1; int y; StaticTest() { y++; } public static void main(String args[]) { StaticTest st = new StaticTest (); System.out.println("x=" + x); System.out.println("st. st= new Static Test (); System.out.println("x=" + x); System.out.println("st. y=" + st. y); y=" + st. y); } static { x++; } public class StringArrayTest{ public static void swap (String [] s) { if (s. length<2) return; String t-s[0]; s[0]=s[1]; s[1]=t; } public static void main (String args[]) { String [] s{"1", "2"}; swap (s); System.out.print (s[0]+s[1]);

class TestExcepRoute { public static void main(String [largs) { try { method(): }catch (Exception e) { System.out.print('m'); } System.out.println('n'); static void createException () { throw new Array IndexOutOfBoundsException (): } static void method () { try{ createException (): System.out.print('a'); } catch (ArithmeticException e) { System.out.print('b'); } finally{ System.out.print('c'); } System.out.print('d'); d) class Student Final f private final long Student ID; private static long number=2007030801; public Student Final () { Student ID = number++; } public long getID() { return Student ID; } public static void main(String[] args) { Student Final [ ] s = new Student Final [3]; for (int i=0; i<s. length; i++) { s=new Student Final (); System.out.println("The Student ID is "+s.getID()); } }