programming languages Online Quiz - 323
Description: programming languages Online Quiz - 323 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
What is the output of the following code when compiled and run? Select one correct answer. public class Question02 { public static void main(String[] args){ int j = 017; int i = (byte)j >> 2; //line 1 System.out.println(Integer.toBinaryString(i)); //line 2 } }
What is the output of the following code when compiled and run? Select one correct answer. public class Question41{ public static void main(String[] args){ Object[] obj = new Object[3]; for(int i=0;i
When an instance of a class, or object, is specified as a parameter to a method, a reference to the said object is passed to the method.
A method in a class declared as static may be invoked simply by using the name of the method alone.
A static method can refer to any instance variable of the class.
Each method in a class must have a unique name.
- Given a one dimensional array arr, what is the correct way of getting the number of elements in arr. Select the one correct answer.
- Select all correct declarations, or declaration and initializations of an array?
4 Which of the following are the java keywords?
6 What will happen when you compile the following code? 1. package sources; 2. public class firstjava { 3. public static void main(String args[]) 4. { 5. private int a[] ={ 4, 4 }; 6. public int b=1; 7. a[b]=b=0; 8. System.out.println("value of b & a[0] & a[1]" + b + a[0] +a[1]); 9. } 10. }