What is the output of the following Java program? public class Q2a { public stat
ID: 3837600 • Letter: W
Question
What is the output of the following Java program? public class Q2a { public static void main (string [] args) { String q = "Are you enjoying programming?"; int len, index; string a1; System. out.println (q); System out.println (q. toLowerCase ()); len = q length(); system. out println ("len is "+ len); index = q.indexOf ("i"); system out.println ("index is " +index); s1 = (q substring (18, len-1) .toUppercase (); system. out.println (s1);} } public class Q2b { public static void main (string[] args) { double x= 75.398; double y = 982. 89764 system. out println ("012345678901234567890123456789"); System. out printf ("87. 4f%n%7. 4f%n", x, y); system. out .print f ("&7.2f%n%7.2%n", x, y)Explanation / Answer
OUTPUT 1 :
OUTPUT 2 :
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.