GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

How many lines of output are provided by this program? publi…

How many lines of output are provided by this program? public class PrintLines {     public static void main(String[ ] args)     {         System.out.print (“Two… “);         System.out.print (“One… “);         System.out.print (“Zero… “);         System.out.println (“Liftoff!”);         System.out.print (“Houston, we have a problem.”);     } }

Read Details

What will the following code fragment print out? String mySt…

What will the following code fragment print out? String myString = “Java”; System.out.println(myString.length());

Read Details

How many lines of output are provided by this program?  publ…

How many lines of output are provided by this program?  public class PrintLines {     public static void main(String[ ] args)     {         System.out.print (“Two… “);         System.out.print (“One… “);         System.out.println (“Zero… “);         System.out.println (“Liftoff!”);         System.out.print (“Houston, we have a problem.”);     } }

Read Details

Write a do-loop that verifies that the user enters an odd in…

Write a do-loop that verifies that the user enters an odd integer value – keep asking for an odd integer until an odd integer is entered.

Read Details

Which of the following verifies that the user enters a non-z…

Which of the following verifies that the user enters a non-zero integer value (keeps asking the user to enter a non-zero integer until a non-zero integer is entered)?

Read Details

str is a String object. Which of the following could throw a…

str is a String object. Which of the following could throw a StringIndexOutOfBoundsException?

Read Details

The following statement is true or false: Java is a case-in…

The following statement is true or false: Java is a case-insensitive language meaning that Out, out and OUT are the same identifier.

Read Details

str is a String object. Which of the following could throw a…

str is a String object. Which of the following could throw a StringIndexOutOfBoundsException?a) str.length( ); b) str.replace(‘a’, ‘A’); c) str.charAt(10);d) str.substring(0, 4);

Read Details

What output is produced by the following code fragment?    …

What output is produced by the following code fragment?     int numerator = 10;   int denominator = 0;   String myStr=”abc”;   try {             System.out.println (numerator / denominator);            System.out.println (“The last character in my Str is ” + myStr.charAt(2));     }   catch (StringIndexOutOfBoundsException ex) {            System.out.println (“String index out of bound.”);    }    catch (ArithmeticException ex) {            System.out.println (“Denominator cannot be zero.”);    }

Read Details

What type error will be generated if a semicolon is missing…

What type error will be generated if a semicolon is missing at the end of a programming statement?

Read Details

Posts pagination

Newer posts 1 … 7 8 9 10 11 … 75,178 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top