Q101
Open questionSelect an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
121
Questions
6/7
Page
Pick an option on a question to see the right answer and solution.
Q101
Open questionSelect an option to see the answer and solution.
Q102
Open questionSelect an option to see the answer and solution.
Q103
Open questionclass Output
{
public static void main(String args[])
{
for (String arg : args)
{
System.out.print(arg);
}
}
}Select an option to see the answer and solution.
Q104
Open questionSelect an option to see the answer and solution.
Q105
Open questionclass abc
{
public static void main(String args[])
{
if(args.length>0)
System.out.println(args.length);
}
}Select an option to see the answer and solution.
Q106
Open questionclass static_out
{
static int x;
static int y;
void add(int a , int b)
{
x = a + b;
y = x + b;
}
}
class static_use
{
public static void main(String args[])
{
static_out obj1 = new static_out();
static_out obj2 = new static_out();
int a = 2;
obj1.add(a, a + 1);
obj2.add(5, a);
System.out.println(obj1.x + " " + obj2.y);
}
}Select an option to see the answer and solution.
Q107
Open questionSelect an option to see the answer and solution.
Q108
Open questionSelect an option to see the answer and solution.
Q109
Open questionclass access
{
static int x;
void increment()
{
x++;
}
}
class static_use
{
public static void main(String args[])
{
access obj1 = new access();
access obj2 = new access();
obj1.x = 0;
obj1.increment();
obj2.increment();
System.out.println(obj1.x + " " + obj2.x);
}
}Select an option to see the answer and solution.
Q110
Open questionclass Output
{
public static void main(String args[])
{
System.out.print(args[0]);
}
}Select an option to see the answer and solution.
Q111
Open questionclass Output
{
public static void main(String args[])
{
int a1[] = new int[10];
int a2[] = {1, 2, 3, 4, 5};
System.out.println(a1.length + " " + a2.length);
}
}Select an option to see the answer and solution.
Q112
Open questionclass box
{
int width;
int height;
int length;
int volume;
void volume(int height, int length, int width)
{
volume = width * height * length;
}
}
class Prameterized_method{
public static void main(String args[])
{
box obj = new box();
obj.height = 1;
obj.length = 5;
obj.width = 5;
obj.volume(3, 2, 1);
System.out.println(obj.volume);
}
}Select an option to see the answer and solution.
Q113
Open questionSelect an option to see the answer and solution.
Q114
Open questionSelect an option to see the answer and solution.
Q115
Open questionpublic class abc
{
int a=2000;
public static void main(String argv[])
{
System.out.println(argv[1]+" :-Please pay Rs."+a);
}
}Select an option to see the answer and solution.
Q116
Open questionSelect an option to see the answer and solution.
Q117
Open questionclass Output
{
public static void main(String args[])
{
System.out.print(args[6]);
}
}Select an option to see the answer and solution.
Q118
Open questionpublic static void main(String args[])Select an option to see the answer and solution.
Q119
Open questionSelect an option to see the answer and solution.
Q120
Open questionSelect an option to see the answer and solution.