JAVA
2.7K subscribers
73 photos
111 files
76 links
Download Telegram
Options
Anonymous Quiz
34%
A
34%
B
26%
C
5%
D
Determine the out of given code snippet?
public class Program
{
int i=1;
int j;
class B extends Program{//line 4
int k=3;//line 5
}
public static void main(String[] args) {
B.k=2;//line 8
System.out.println(i+" "+k);
}
}
public class Program
{
public static void main(String[] args) { int[] a1={1,2,3,4}; int[] a2=new int[5]; for(int i=0;i<a1.length;i++){ a2[i]=a1[i]; } System.out.println(a2[4]); } }
Anonymous Quiz
14%
0
29%
4
47%
ArrayIndexOutOfBoundException
10%
NullPointerException
Suppose you were Implementing a data structure to store information about the instruments on specification at an instruments dealer showroom. Of the following data structure, which one is the right one to use?
Anonymous Quiz
18%
Unordered Array
18%
Sorted Array
20%
LinkedList
14%
Binary search tree
29%
HashMap
public class Program
{
public static void main(String[] args) {
byte a=10;
float b;
int c;
b=(float)++a*a;
c=(short)b;
System.out.println(a++ + ++b +.1);
System.out.println(b +.1);
System.out.println(c +.1);
}
}
which of the following Exception is thrown by Jvm when code uses negative size while initializing an array
Anonymous Quiz
25%
NullPointerException
12%
NumberFormatException
25%
IllegalArgumentException
37%
NegativeArraySizeException
public class Program
{
int i;
int j;
int k;
Program(){
j=2;
}
Program(int m,int n){
super();
i=m;
k=n;
}
Program(int x){
super();
j=x;
}
public static void main(String[] args) {
Program p=new Program(4);
System.out.println(p.i+" "+p.j+" "+p.k);
}
}
Which of the below is bidirectional cursor in Collection (JAVA)?
Anonymous Quiz
6%
Iterator
23%
Enumeration
44%
ListIterator
27%
All the above
Q. You want subclasses in any package to have access to members of a superclass. which is the most restrictive that accomplishes this objective?
Anonymous Quiz
25%
Private
39%
Public
10%
Transient
25%
Protected
Q. If an unique key constraint on DATE column is created will it accept the rows that are inserted with SYSDATE?
Anonymous Quiz
59%
Will
41%
Won't