Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions