0
Alien head

programming languages Online Quiz - 91

Description: programming languages Online Quiz - 91
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

What is the size for double data type in c#

  1. 1 Byte

  2. 2 Byte

  3. 4 Byte

  4. 8 Byte

  5. 16 Byte


Correct Option: D

System.out.println(4 | 3);

  1. 6

  2. 0

  3. 1

  4. 7


Correct Option: D

Which of the following are keywords or reserved words in Java?

  1. if

  2. then

  3. goto

  4. while


Correct Option: B

A byte can be of what size

  1. -128 to 127

  2. (-2 power 8 )-1 to 2 power 8

  3. -255 to 256

  4. 8


Correct Option: A

Which of the following lines will compile without warning or error.

  1. float f=1.3;

  2. char c="a";

  3. int i=10;

  4. boolean b=null;


Correct Option: C

if(check4Biz(storeNum) != null) {} Referring to the above, what datatype could be returned by method check4Biz()?

  1. Boolean

  2. int

  3. char

  4. float


Correct Option: A

Which of the following is not a keyword or reserved word in Java?

  1. if

  2. then

  3. goto

  4. while

  5. case


Correct Option: B

If you wanted to find out where the position of the letter v (ie return 2) in the string s containing "Java", which of the following could you use?

  1. mid(2,s);

  2. charAt(2);

  3. s.indexOf('v');

  4. indexOf(s,'v');


Correct Option: C

What will happen if you try to compile and run the following code public class MyClass { public static void main(String arguments[]) { amethod(arguments); } public void amethod(String[] arguments) { System.out.println(arguments); System.out.println(arguments[1]); } }

  1. error method main not correct

  2. error Can't make static reference to void a method.

  3. error array must include parameter

  4. a method must be declared with String


Correct Option: B

Which of the following will throw an error while compilation 1) import java.awt.; package Mypackage; class Myclass {} 2) package MyPackage; import java.awt.; class MyClass{} 3) /This is a comment */ package MyPackage; import java.awt.; class MyClass{}

  1. Option 1

  2. Option 2

  3. Option 1 & 2

  4. Option 3

  5. Option 2 & 3


Correct Option: A

Which of the following lines will compile without warning or error.

  1. float f=2.3;

  2. char c="z";

  3. boolean b=null;

  4. int i=21;

  5. byte b=257;


Correct Option: D

What is the result of the following operation? System.out.println(4 | 3);

  1. 6

  2. 0

  3. 1

  4. 7


Correct Option: D

Which of the following will output -4.0

  1. System.out.println(Math.floor(-4.7));

  2. System.out.println(Math.round(-4.7));

  3. System.out.println(Math.ceil(-4.7));

  4. System.out.println(Math.min(-4.7));


Correct Option: C

What data will be printed out if you attempt to compile and run the following code(ignore newline in output)? int i=1; switch (i) { case 0: System.out.println("zero"); break; case 1: System.out.println("one"); case 2: System.out.println("two"); default: System.out.println("default"); }

  1. one

  2. one default

  3. one two default

  4. default


Correct Option: C

A byte can be of what size

  1. -128 to 127

  2. (-2 power 8 )-1 to 2 power 8

  3. -255 to 256

  4. depends on the particular implementation of the Java Virtual machine


Correct Option: A

What will be printed out if this code is run with the following command line? java myprog good morning public class myprog{ public static void main(String argv[]) { System.out.println(argv[2]); } }

  1. myprog

  2. good

  3. morning

  4. Exception raised: "java.lang.ArrayIndexOutOfBoundsException: 2"


Correct Option: D

Visual Basic uses an object called ______ to hold your table?

  1. file

  2. Record

  3. table

  4. RecordSet


Correct Option: D

Which of these is not an collection of the VB project?

  1. The object module

  2. The class module

  3. The form module

  4. The global module


Correct Option: A

On start up, which of these window is not displayed?

  1. The Class window

  2. The Project window

  3. The Properties window

  4. The Blank Form window


Correct Option: A

Which of these is used to open an database?

  1. Set dbMyDB = OpenDatabase

  2. Set dbMyDB = OpenDatabase("MyDatabase.mdb")

  3. dbMyDB = OpenDatabase("MyDatabase.mdb")

  4. None of these


Correct Option: B
+ View questions