Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Intro to java 8. Which of the following lines of code will output accepted if the user types password below? Scanner sc new Scanner (System.in):
Intro to java
8. Which of the following lines of code will output "accepted if the user types "password" below? Scanner sc new Scanner (System.in): String inputLine = sc.nextLine(); A. B. C. D. if (inputLine -- "password") System.out.println("accepted"); if(inputLine = "password"). System.out.println("accepted"); if (inputLine.equals ("password")) System.out.println("accepted")i All of the above E. Both A and C will work, but B will not. 9. What will be output by the program below? public class 09 static void fff (intt) x) // add code here for question 10 (line F) public static void main (String args) inta new int[1001 a[0] = 3; fE (a) i system.out.print (a[0]) I/ replace this line for question 10 (line G) A. 0 B. 3 C. 5 D. 7 E. 100 10. What will be output if we change the program in question 9 above, adding this line to the end of ff: x = new int [5]; // line F and replacing the last line of main with: System.out.print (a.length): 1/line G A. 0 ?, ? C. 5 D. 7 E. 100 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started