After executing the code on the right what will be the output? String obj = "Java is nice"; System.out.print (obj.charAt(3) + "*" + obj.substring(5,7)); A a*is B v*is C a*is nice D v*is nice
Added by Rebecca R.
Close
Step 1
The code starts by declaring a String variable named "obj" and assigning it the value "Java is nice". Show more…
Show all steps
Your feedback will help us improve your experience
Patricia Holmes and 98 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
What is the output of the following? class GFG { public static void main (String[] args) { int[] arr = new int[2]; arr[0] = 10; arr[1] = 20; for (int i = 0; i < arr.length; i++) System.out.println(arr[i]); } }
Madhur L.
Note: the println() function prints out a line of text with the value that you pass to it - so if you say println("Hi"), it will output: Hi Consider the following code: var i = 0; while (i < 3) { println("hi"); i++; } What does the code output? Choose 1 answer: (Choice A) hi hi hi (Choice B) hi hi (Choice C) hi
Harriet O.
What will be output from the following code segment, assuming it is in the same class as the do something method? int [] arr $=\{1,2,3,4\}$ doSomething (arr) ; System.out.print $(\operatorname{arr}[1]+" ")$ System.out.print(arr[3]); public void doSomething(int [] list) { int [] b $=1$ ist for (int $i=0 ; \text { i }<\text { b. length; } i++)$ $b[i]=i$ } (A) 00 (B) 24 (C) 13 (D) 02 (E) 0 3
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD