Q161
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.
309
Questions
9/16
Page
Pick an option on a question to see the right answer and solution.
Q161
Open questionSelect an option to see the answer and solution.
Q162
Open questionSelect an option to see the answer and solution.
Q163
Open questionSelect an option to see the answer and solution.
Q164
Open questionSelect an option to see the answer and solution.
Q165
Open questionimport java.lang.reflect.*;
class Additional_packages
{
public static void main(String args[])
{
try
{
Class c = Class.forName("java.awt.Dimension");
Field fields[] = c.getFields();
for (int i = 0; i < fields.length; i++)
System.out.println(fields[i]);
}
catch (Exception e)
{
System.out.print("Exception");
}
}
}Select an option to see the answer and solution.
Q166
Open questionSelect an option to see the answer and solution.
Q167
Open questionSelect an option to see the answer and solution.
Q168
Open questionSelect an option to see the answer and solution.
Q169
Open questionSelect an option to see the answer and solution.
Q170
Open questionSelect an option to see the answer and solution.
Q171
Open questionimport java.awt.*;
import java.applet.*;
public class myapplet extends Applet
{
Graphic g;
g.drawString("A Simple Applet",20,20);
}Select an option to see the answer and solution.
Q172
Open questionimport java.io.*;
public class filesinputoutput
{
public static void main(String[] args)
{
String obj = "abc";
byte b[] = obj.getBytes();
ByteArrayInputStream obj1 = new ByteArrayInputStream(b);
for (int i = 0; i < 2; ++ i)
{
int c;
while ((c = obj1.read()) != -1)
{
if(i == 0)
{
System.out.print((char)c);
}
}
}
}
}Select an option to see the answer and solution.
Q173
Open questionSelect an option to see the answer and solution.
Q174
Open questionSelect an option to see the answer and solution.
Q175
Open questionSelect an option to see the answer and solution.
Q176
Open questionSelect an option to see the answer and solution.
Q177
Open questionSelect an option to see the answer and solution.
Q178
Open questionSelect an option to see the answer and solution.
Q179
Open questionSelect an option to see the answer and solution.
Q180
Open questionimport java.io.*;
class Chararrayinput
{
public static void main(String[] args)
{
String obj = "abcdefgh";
int length = obj.length();
char c[] = new char[length];
obj.getChars(0, length, c, 0);
CharArrayReader input1 = new CharArrayReader(c);
CharArrayReader input2 = new CharArrayReader(c, 1, 4);
int i;
int j;
try
{
while ((i = input1.read()) == (j = input2.read()))
{
System.out.print((char)i);
}
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}Select an option to see the answer and solution.