Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I just want the final answer 1. What is the output of the following code segment? int w = 4; int i = 3; switch(w){

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

I just want the final answer

1. What is the output of the following code segment? int w = 4; int i = 3; switch(w){ case 4: i=2; default : it=3; } System.out.println(i); A. 2 B. 7 C. 5 D. 15 2. The output of the java statement: System.out.println("Zarqal\tUniversity") is? A. ZarqaltUniversity B. Zarqa University C. Zarqa \t University D. Zarqal\tUniversity 3. What is the output of the following java code? final int mark = 90; mark = 85; System.out.println(mark); C. 85 D. mark A. 90 B. Syntax error 4. What will be the values of x and y after executing the following code? int x = 0, y, z; y = 2; z=3; x+=(y+) + z; A. x= 4, y=3 B. x= 5, y = 3 C. x=6, y=3 D. x=6, y=2 5. What is the value of fname variable after executing the following code? String str; int fname; str = "Information Technology"; fname = str.indexOf( "Te"); A. 11 B. 12 C. 10 D.-1 6. Given the following code, What is the value of salary (3]? int salary ( ); int index=0; salary = new int [4]; while (index (b /c)); B. 0 C. false A. true D. Syntax error 12. One of the following statements is incorrect? A. int x = 2/5; B. int x = 5/2; C. int x = (int) 5/2.0; D. double x=5/2.0; 13. What is the output of the following java code? for(int i=1;i= 1); System.out.print (i); . 0 B. ABC1 C. ABCO D. BCABCO 17. The output of the following segment is: int i=0, j = 0; for(i = 0; ii) break; C.0 D. 01 B. 0149 A. 014 18. What is the output of the following java code? int a = 10, b = 5, c = 4; if (a >c) { System.out.print("Start"); if( c>2 && a>b) System.out.println("Nested"); } else { Ssystem.out.println("End"); C. Nested D. Start A. End B. Start Nested 19. What is the output of the following code segment? String str = "Java language"; String newStr = str.substring(6, 10); System.out.println( newStr); A. language D. angua B. guage C. angu 20. The output of the following statement is: System.out.print( 10 + (int)Math.random()); C. 10 D. O A. a number less than 10 B. a number more than 10

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_2

Step: 3

blur-text-image_3

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

=+j Understand different types of regions in the world.

Answered: 1 week ago