ExamVeda
Login
Home
71
Which of these methods is a part of Abstract Window Toolkit (AWT) ?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
72
Which of these modifiers can be used for a variable so that it can be accessed from any thread or parts of a program?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
73
Which of these operators can be used to get run time information about an object?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
74
What is the Message is displayed in the applet made by the following Java program?
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet
{
    public void paint(Graphics g)
    {
        g.drawString("A Simple Applet", 20, 20);    
    }
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
75
What is the length of the application box made by the following Java program?
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet
{
    public void paint(Graphics g)
    {
        g.drawString("A Simple Applet", 20, 20);    
    }
}
Discuss
Answer & Solution
Answer: Option D
Solution:
The Java program provided uses the AWT and Applet classes to draw a string on the screen using the paint() method.

However, it does not explicitly specify the size (length or width) of the application box (applet window).

When an applet does not set its size using methods like setSize(), the actual size of the applet is determined by the HTML page that embeds the applet or by the applet viewer or browser displaying it.

Because different systems and viewers may allocate different default sizes, the length of the application box is therefore system dependent.
76
What is the length of the application box made the following Java program?
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet
{
    Graphic g;
    g.drawString("A Simple Applet", 20, 20);    
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
77
What will be the output of the following Java program?
import 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)
        {
            e.printStackTrace();
  }
}
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board