Description: programming languages Online Quiz - 18 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
Which of the following is not a C# keyword?
Setter is a special method, that sets property value. Used for private or protected variables or for some additional validation
What was the first language to bring together all the features that characterize an object-oriented programming system?
Overloading, overriding and dynamic method binding are three types of what?
Which class is the highest superclass of Java?
What is the name for an application changing a readable programming language into a machine-readable language?
Short-circuit parameters are && and ||
String strA; String strB = new String("Cheese"); How many objects have been created in the above code snippet?
What is another name for creating an object?
What attributes do all real world objects have?
What is the result of trying to compile and run the following code. public static void main(String[] args){ double d = 10 / 0; if(d == Double.POSITIVE_INFINITY) System.out.println("Positive infinity"); else System.out.println("Negative infinity"); }
Identify the invalid assignments.
The range of a byte is from -127 to 128.
The following code is legal? long longArr[]; int intArr[] = { 7 ,8 , 9}; longArr = intArr;
What will happen if you try to compile and run this ? public class Test{ static{ print(10); } static void print(int x){ System.out.println(x); System.exit(0); } }
What is the result of trying to compile and run this program. public class Test{ public static void main(String[] args){ int[] a = {1}; Test t = new Test(); t.increment(a); System.out.println(a[a.length - 1]); } void increment(int[] i){ i[i.length - 1]++; } }
Which of the following are valid declarations?
What is the result that will be printed out ? void aMethod() { float f = (1 / 4) * 10; int i = Math.round(f); System.out.println(i); }
What is the result of trying to compile and run the following code. public final static void main(String[] args){ double d = 10.0 / -0; if(d == Double.POSITIVE_INFINITY) System.out.println("Positive infinity"); else System.out.println("Negative infinity"); }
You have the following code in a file called Test.java class Base{ public static void main(String[] args){ System.out.println("Hello"); } } public class Test extends Base{} What will happen if you try to compile and run this?