0

programming languages Online Quiz - 324

Description: programming languages Online Quiz - 324
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0
    1. Change public abstract class Vehicles { } to public class Vehicles { }
    1. Change public class Bus { } to public class Bus extends Vehicles { }
    1. Change public class MyClass { to private class My Class {
    1. Change public abstract class Vehicles { } to protected abstract class Vehicles { }

Correct Option: B

. Which line of the following code would make the test object eligible for garbage collection? (Line numbers are included only for clarity's sake) 1. public class Garbage { 2. public static void main(String [] args) { 3. StringBuffer test = new StringBuffer("hello"); 4. System.out.println(test); 5. test = null; 6. } 7. }

    1. 3
    1. 4
    1. 5
    1. No lines enable the garbage collection of the test object.

Correct Option: C
  1. 1 This is the pseudocode representing the two types of assert statements:

  2. 2 Always handle an AssertionError in a try-catch-finally block.

  3. 3 This is the pseudocode representing the two types of assert statements:

  4. 4 Assertions of the 'assert booleanExpression;' variety should not be disabled before distributing the software.


Correct Option: A
    1. static String [50] sSyntax = new String[];
    1. String [] sSyntax = new String[50];
    1. static String [] sSyntax = new String[50];
    1. static string [] sSyntax = new string[50];

Correct Option: C
    1. The quotes should not be around false.
    1. New should be after Boolean.
    1. A boolean is expected not a Boolean.
    1. The Semi-colon should not be used.

Correct Option: C

You have the following code: public class Java { public static void main (String [] args) { double dSyntaxs; System.out.println("Its: " + dSyntaxs); } public void TrueSyntax() { System.out.println("True syntax is a work of art."); } } What would the output be? Incorrect. The correct option is as follows

    1. Its: 1
    1. Its: 0
    1. Its: true
    1. Its: 0.0
    1. A compiler error

Correct Option: E
  1. lines2list

  2. list2lines

  3. select

  4. showbind


Correct Option: A,C

What is equalent ScriptLINK command for "filestat"

  1. =

  2. ?

  3. @

  4. +


Correct Option: B

In the command search-string parameter -s is used for

  1. Name of textbuffer in which each line of that does not contain

  2. Name of textbuffer in which the line numbers of that

  3. All the above

  4. None of the above


Correct Option: A

What is the output for the following expression = ceil {-4.5}

  1. 5

  2. -4

  3. 4

  4. -5


Correct Option: B
  1. Dennis Ritchie

  2. Bjarne Stroustrup

  3. James Gosling

  4. Paul Allen


Correct Option: C

Java was intially called as

  1. green

  2. Oak

  3. bean

  4. applet


Correct Option: B

Which is not the scripting language

  1. Java Tcl

  2. JRuby

  3. Sleep

  4. JavaOne


Correct Option: D

Which is not the keyword

  1. java

  2. boolean

  3. super

  4. this


Correct Option: A
  1. while(true){ }

  2. for(i=0;i>1;i--){ i++ }

  3. for ( ; ; ) { }

  4. while(false){ }


Correct Option: C

What is the output of the following code when compiled and run? Select two correct answers. public class Question01 { public static void main(String[] args){ int y=0; //line 1 int x=z=1; //line 2 System.out.println(y+","+x+","+z); //line 3 } }

  1. Prints 0,1,1

  2. Error during compilation at line 1

  3. E. Error during compilation at line 2

  4. Error during compilation at line 3


Correct Option: C,D
- Hide questions