programming languages Online Quiz - 340
Description: programming languages Online Quiz - 340 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
Consider the following piece of code: 1 long i = 2 ; 2 switch (i) { 3 case 1: 4 System.out.println ("Case 1"); 5 case 2: 6 System.out.println ("Case 2"); 7 case 3: 8 System.out.println ("Case 3"); 9 default: 10 System.out.println ("Default"); 11 } Which of the following lines will be included in the output? (Choose all that apply, please bear with code as formating it sems is not possible,first numbers represent line numbers)
In Java the compiler will always insert a default , no argument constructor into any class definition
In a method call when an object reference is passed as an argument , So what gets passed actually ?
In Java if an arithmetic operation is performed then , In case the operands are of different types the resulting type is always the widest of two types
consider the following scenarioint i = 0;if ( i ) {System.out.println("This won't print");}else{System.out.println("This prints");}
A constructor can be declared abstract
The legal values for a boolean in java are choose all that applies
Its possible for a non-abstract class to have abstract methods.
The following statement would allocate memory on? char *ptr = malloc(10);
In the following code variable test would be created on? static int test;
In the following code variable test1 would be allocated memory on?int func(){int test1 = 10;return test1;}void main(){ int i = 0; i = func();}
In the following segments which is the read only segment?
Can we change the content of string letral?
Can a constructor be declared as private?
The access modifier of an overloaded method is different. Is this valid?
The following code is compiled: double abc = 100.0; double xyz = abc/0; What is the result?
Consider the following case: A return statement is there in the catch block. An exception occurs and is caught. Now will the finally block be executed?
Overloaded methods should not throw new checked exceptions that have not been thrown by the original method?
Consider the following case: A = false B = true; What is the result of A && B ?
Consider the following case; int i; int k; for(i=0;k<10;i++){/* The body */} This will not compile?