Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 24 How many times will the following code print Welcome to Java? int count = 0; do { System.out.println(Welcome to Java); count ) while

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
QUESTION 24 How many times will the following code print "Welcome to Java"? int count = 0; do { System.out.println("Welcome to Java"); count ) while (counts 10). 08 OOOO 9 10 11 0 Analyze the following code public class Test public static void main(String[] args) { System.out.println(m(2)). ) public static int mint num) { return num 1 public static void m(int num) { System.out.println(num): 0000 The program runs and prints 2 twice. The program has a compile error because the second m method is defined, but not invoked in the main method The program has a compile error because the two methods m have the same signature The program runs and prints 2 once. QUESTION 26 Which of the following is not an advantage of using methods O Using methods makes reusing code easier Using methods makes programs easier to read. Using methods hides detailed implementation from the clients Using methods makes programs run faster QUESTION 27 The signature of a method consists of O method name and parameter list parameter list return type, method name, and parameter list method name Oooo QUESTION 28 Analyze the following code public class Test public static void main(String[] args) { System.out.println(xMethod(5. 500L)): public static int xMethod(int n, long 1) System.out.println("int, long"): return ng } public static long xMethod(long n, long 1 System.out.println("long, long"); return n; The program runs fine but displays things other than 5. The program displays int, long followed by 5. The program displays long, long followed by 5. The program does not compile because the compiler cannot distinguish which method to invoke Windows bucick Save and Submit to save and submit. Click Save All Answers to save all answers. lp the program does not complete the commerce wicht QUESTION 20 A variable defined inside a method is referred to as O a global variable O a block variable a local variable a method variable QUESTION 30 Suppose array a is int[] = {1,2,3), what is a[0] - a[2]? 00000 3 QUESTION 31 Which of the following are vad array decorations O chal charay new char26]. O chart charArray - "Computer Science"; O double 3 nums 35,35 1,320) Intl words now words10 QUESTION 32 Consider the following code fragment int[] list = new int[10): for (int i = 0; i

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

Icdt 88 2nd International Conference On Database Theory Bruges Belgium August 31 September 2 1988 Proceedings Lncs 326

Authors: Marc Gyssens ,Jan Paredaens ,Dirk Van Gucht

1st Edition

3540501711, 978-3540501718

More Books

Students also viewed these Databases questions