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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 31 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 31 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()); } }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply