Professional Documents
Culture Documents
word
12 Applet can be embedded in a RTF file html file gif file C
document
Which of these classes are used by character Writer and
13 InputStream ReadStream InputOutp B
streams for input and output operations? Reader
utStream
Which of these is a type of stream in Java? Integer Long
14 Short stream Byte stream C
stream stream
Which of the following methods not
15 write( ) skip( ) close( ) flush( ) B
included in OutputStream class.
Which of the following method(s) not
16 available( ) reset( ) flush( ) close( ) C
included in InputStream class.
Which of these is a method to clear all the
17 clear() close() B
data present in output buffers? flush() fflush()
Which of these methods are used to read in readFileIn
18 get() read() scan() B
from file? put()
Which of these methods belongs to
19 Graphics class? display() paint() drawString() transient() C
20
which of the following statements about An applet is a An applet is a An applet is a An applet
21 hierarchy of the class java.awt.Applet is kind of kind of kind of is a kind C
incorrect? container window component of panel
22 The class at the top of the AWT hierarchy is component window container frame A
On invoking repaint() method for a
23 component, the method invoked by AWT draw() show() update() paint() D
is:
The ………… attribute of applet tag
specifies the amount of horizontal blank SPACE=pixe HSPACE=pi HWIDTH=pi HBLANK
24 B
space the browser should leave surrounding ls xels xels =pixels
the applet.
We can change the text to be displayed by
<PARAM
25 an applet by supplying new text to the <EDIT> <CHANGE> <REPLACE> D
>
applet through a ………… tag.
Which of these classes defined in java.io
and used for file-handling are abstract?
InputStream
26 PrintStream Only A Only C A and C A and B C
Reader
FileWriter
Applets can't
An applet
load libraries
Which are the common security restrictions can't read Applets can Both A &
37 or define D
in applets? every system play sounds B
native
property
methods
38
<PARAM <PARAM
<PARAM <PARAM
NAME="x" VALUE=
39 Write the syntax of param tag NAME=x VALUE=y C
VALUE="y" "y"
VALUE=y> NAME=x>
> NAME="
x" >
read()
List two primary methods for reading bytes write(int) read() length()
40 read(byte[]) B
from an input stream write(byte[]) write() charAt()
read()
List two primary methods for writing bytes write(int) read() length()
41 read(byte[]) A
to an output stream write(byte[]) write() charAt()
Filereader
fileReader fr FileReader fr
FileReader fr fr = new
How will you create the object for reading = new = new
42 = new Filereader C
from file xyz.txt fileReader("x FileReader("x
("xyz.txt"); ("xyz.txt")
yz.txt"); yz.txt");
;
FileWriter Filewriter
filewriter None of
How will you create the object for writing fw=new fw=new
43 fw=new(“xyz the A
into file xyz.txt FileWriter("x Filewriter("xy
.txt”); mentioned
yz.txt"); z.txt");
none of
directory in
44 Which of these is specified by a File object? a file in disk directory path the C
disk
mentioned
<applet
param=Te
<applet <applet> <applet
Which of the following applet tags is legal st.class
class=Test code=Test.cla code=Test.cla
to embed an applet class named Test into a width=20
45 width=200 ss width=200 ss width=200 D
webpage? 0
height=100> height=100> height=100>
height=10
</applet> </applet> </applet>
0>
</applet>
User I/O
Applets is
Applets do Applet uses
should be run accomplis
not need a the interface
46 Analyse what is not true about applets? under a java hed with D
main() provided by
compatible java's
method AWT
browser stream I/O
classes
public class abstract
public class
MyApplet class
MyApplet
which one of the following is a valid public Applet extends MyApplet
47 extends
declaration of an applet? MyApplet { applet extends
java.applet.A
implements java.apple
pplet {
Runnable { t.Applet {
<param
If you want to assign a value of 27 to the
number = <param = name=mar
variable marks, then which of the following
48 getParameter( <number=27 marks ks D
lines can be used within an <applet> tag.
27) > value=27> value=”27
”>
49
What will be the output of the following
program?
import java.io.FileWriter;
import java.io.IOException;
class Write
{
public static void main(String[] args)
contents of str
throws IOException display “A
will be runtime
50 { quick brown compile error A
written into error
String str = "A quick brown fox"; fox”
xyz.txt
FileWriter fw=new
FileWriter("xyz.txt");
for (int i = 0; i < str.length(); i++)
fw.write(str.charAt(i));
fw.close();
}
}
import java.io.*;
class files
{
53 java true java false \java false \java true C
public static void main(String args[])
{
File obj = new File("/java/system");
System.out.print(obj.getParent());
System.out.print(" " + obj.isFile());
}
}
import java.io.*;
class test
{
public static void main(String args[])
54 { java/system java /java/system system D
File obj = new File("/java/system");
System.out.print(obj.getName());
}
}