0% found this document useful (0 votes)
55 views

CS506

This document contains information about a Grand Quiz service being available for assignments, quizzes, GDBZ and grand quizzes. It includes a table with questions, answers and subject codes for a grand quiz test.

Uploaded by

aliflam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

CS506

This document contains information about a Grand Quiz service being available for assignments, quizzes, GDBZ and grand quizzes. It includes a table with questions, answers and subject codes for a grand quiz test.

Uploaded by

aliflam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

LMS handling service are

available

GRAND QUIZ PAID


Assignment, QUIZ, GDBZ and
GRAND QUIZ SERVICE are
0304-1659294 available

JUNAID MALIK 0304-1659294


AL-JUNAID INSTITUTE GROUP
CS506 GRAND QUIZ

Sr.N MCQS ANSWER:


O QUESTIONS:
1 FTP (File Transmission
Protocol) works on 21
_____________ port.

2 Which of the following is Generally used as public utility


NOT true for java inner classes
classes?
3 Which statement from the (A) It is difficult to understand
following statements is (B) It has no name
true about java (C) it is much shorter
Anonymous Inner class Answer:(D) All of the given options
4 While running following
ExceptionExample.java
class on command line
without passing Array index out of bound exception
command line arguments
gives ________
exception.
public class Exception
Example {
public static void main
(String args[]){
System.out.println(args[0
]);
}}
5 Exception handling code catch block
is written in ______.
6 Let suppose a column has String name=rs.getString(5)
index 5 in the ResultSet
object. Which of the
following statement is
AL-JUNAID INSTITUTE GROUP
used to retrieve the
column values?
7 Which of the following FileInputStream
streams is a byte oriented
stream?
8 Which of the following Primitive data types are created on
statements is true about stack whereas references are created
primitive data types and on heap
reference data types?
9 Which command of the javac JavaTest.java
following commands is
used to compile "Java
Test" java file's code?
10 Which of the following It first paints the background and then
statements is true performs custom painting.
regarding
paintComponent()
method?
11 WindowListener interface Seven
contains ________
methods.
12 HashMap takes key as Object
a/an ________
13 Adapter classes have
been defined for listener ActionListener
interfaces except
_________ interface.

14 Interface imposes design


_____________ structure
on any class that uses
interface
15 Which of the following is Tells the components border (if any)
NOT true about to paint.
paintComponent()
method?
16 An object of Student.java
AL-JUNAID INSTITUTE GROUP
class is creating and
setting its value in
Test.java class setName method should not be
__________ error is there accessed by arrow operator
in given code.
public class Test{
public static void main
(String args[]){
Student s2 = new
Student();
s2-
>setName("Aslam");
}
}
17 The "MouseDragged" and MouseMotionListner
"mouseMoved" method
are defined in _________
interface.
18 previous() is a method of ResultSet
__________ object.
19 Which of the following Type 4: Native - protocol /all - java
driver type(s) has better driver
performance than other?
20 For a programmer the
event handling is a three Publish event
step process in term of
code. Which of the
following is NOT an
event handling step?
21 Which feature of the Function Overriding
following features does
Java provide?
22 What will happen if static The program will compile but not run.
modifier is removed from
the signature of main
method?
23 Bytecodes are put in class loader
AL-JUNAID INSTITUTE GROUP
memory by
____________.
24 Which of the following is Public class PersonInfo implements
the correct syntax to Serializable {/*class body*/}
make a PersonInfo class
into a Serializable class
25 The following code
creates and starts a timer
that fires an action event Second
once per ________

Timer t = new
Timer (1000,this);
t.start();
26 CmdArgs java class is
compiled. If the
command "java CmdArgs
CS506" run in cmd, then
what will be output of CS506
given code.

Public class CmdArgs{


public static void main
(String[]args){
System.out.println("First
argument" + args[0]);
}
}
27 Which of the following public void
functions is declared in mouseDragged(MouseEvent me);
MouseMotionListener
interface?
28 Which of the following
classes provide adapter classes
definitions for all the
methods (empty bodies)
of their corresponding
AL-JUNAID INSTITUTE GROUP
Listener interface?
29 What will happen if main The program will throw an exception
method is declared as at run time
private?
30 To make sure array
accesses touch only the dynamic
memory allocated to
them. JVM does
_________checking at
runtime.
31 What will happen if static The program will compile but not run
modifier is removed from
the signature of main
method?
32 Which of the following is Generally used as public utility
NOT true for java inner classes
classes?
33 A hash map object is to HashMap <String,Teacher> h =new
create, to store Teacher HashMap<String, Teacher>();
objects as values and
their CNIC in the form of
strings as keys.
Which syntax is correct
for this requirement?
34 A scrollable and
updatable ResultSet insert new columns
object has the following
capabilities except______

35 Which of the following Concrete class


classes is capable to
instantiate?
36 Which of the following Graphics object
objects is passed as an
argument to
paintComponent()method
?
AL-JUNAID INSTITUTE GROUP
37 It is verified by bytecode verifier
__________ that not all
bytecodes violate java
security restrictions.
38 An event in java is Object
represented as
___________.

39 In given lines of code


____________________ downcasting a to b type
is applying.
double a = 9.5;
int b = (int) a;
40 Which of the given will super.paintCompnent()
clear all the previous
painting?
41 The following is an Node stream
example of _________.
FileReader fr = new
FileReader("input.txt");
42 Strings in java are Reference data types
represented as
_________.

43 AWT is also called Heavy weight components


______.

44 Choose the correct syntax


to define an interface public interface Speaker{}
named as "Speaker" in
java language.
45 In Java, if a super class
method is protected then may be either protected or public
overriding method
___________.

46 Timer class constructor milli seconds


AL-JUNAID INSTITUTE GROUP
requires time in____
.
47 The ___________ is Node stream
directly connected with
keyboard.
48 For each class contained one
in java source file,
compiler generates
_________ class file/s.
49 In given lines of code
____________________ upcasting a to b type
is applying.
int a = 20;
double b = a;
50 Which of the following destroy()
methods is called only
once during the life cycle
of an Applet?
51 If there is a class Student.java
"Student", then the java
files must be saved with
________ name.

52 Which of the following Statement


statement object is used
to execute simple SQL
statement?
53 Which feature of the Pointer manipulation
following featured is not
included in Java
language?
54 Which of the following ParseInt()
methods is used to
convert a string into an
int value?
55 Which of the following is NumberOfStudent
a valid variable name in
AL-JUNAID INSTITUTE GROUP
Java?
56 Which of the following Primitive data types
features is available in
java?
57 A port is a Transport Address
__________________ to
which processes can
listen for connections
request.
58 Which of the following is Interface
called "pure abstract
class"?
59 Which of the following java.io
packages needs to import
while handling files?
60 How many simultaneous 128k
connections can be
opened using TCP and
UDP ports?
61 Which of the following
statements is a correct public void
statement for "mouse mouseReleased(MouseEvent me)
release" event in
"MouseListener"
interface?
62 ______________ is/are ArrayList class
not part of java core
language.
63 Strings in java are
represented as Reference data types
___________.

64 ________________ in a Constructor
collection class creates a
collection with no
elements.
65 == operator compare
AL-JUNAID INSTITUTE GROUP
____________ of strings Addresses, values
whereas equals() method
compare ________ of
strings.
66 Assume that we do not
want to serialize transient String phoneNum;
phoneNum attribute of
Personinfo class, this can
be done by;

67 java program's code is Byte code


compiled into a form
called
68 Which command of the
following commands is java JavaTest
used to run "Java Test"
Java file's program?
69 Java defines
___________ for the Adapter classes
listener interfaces having
more than one event
handling methods.
70 You must include a
______________ to throws-clause
declare an exception that
might be thrown to
another method.
71 If you want to animate
something like ball, False
moving from one place to
another, we constantly
need to call paint ()
method.
72 In the context of Java paintComponet()
Graphics, which of the
following we should
override while painting?
AL-JUNAID INSTITUTE GROUP
73 Which of the following Multiple inheritance
features is not available
in Java?
74 If a JPanel has a triangle paintComponet()
drwan on it which of the
following method will
display it?
75 Which of the following is Connection con =
correct java code DriverManager.getConnection(conU
statement that is used to RL)
establish the connection?
76 Which of the following IOException
exception belongs to a
category of checked
exception?
77 A collection can store Heterogeneous objects
_____________.

78 Which of the following


statement object is used PreparedStatment
to execute precompiled
SQL statements?
79 Which of the following FileInputStream
stream read/write data in
the form of bytes?
80 Which of the following executeUpdate(sql);
method is used to execute
INSERT, UPDATE and
DELETE SQL statements
81 HashMap takes key as Object
a/an _____
82 ArrayList is an example Sequence Based
of ___________
collection type
83 If we want to animate False
something like ball,
moving from one place to
AL-JUNAID INSTITUTE GROUP
another, we constantly
need to call paint ()
method.
84 Which of the following is JPanel
a general purpose
container?
85 ResultSet provides Data of the column
various gathers to retrieve
________________.
86 In editor java programs Disk
are created while stored
on/in
________________.
87 If a class needs to handle ActionListner
event generated by button
then which of the
following interface a
class needs to implement?
88 Which of the following Adapter Classes
classes provide
definitions for all the
methods (empty bodies)
of their corresponding
Listener interface
89 Which of the following is Interface
called “pure abstract
class”
90 A default ResultSet Moves Forward Only
object has a cursor that
__________________-.
91 Which of the given will super.paintComponent()
clear all the previous
painting?
92 Which of the following is executeQuery(sql)
NOT a method of
ResultSet object?
93 Java defines _________ Adapter Classes
AL-JUNAID INSTITUTE GROUP
for the listener interfaces
having more than one
event handling methods
94 Which of the following addFocusListener
feature is not included in
Java?
95 All AWT and swing True
component generate
events
96 ___________________ ArrayList class
is/are not part of jaca
code language
97 The collection API are Java.util
defined in ___________
package.
98 Which of the following PreparedStatement
statement object is used
to execute precompiled
SQL statements?
99 The _____________ is Node stream
directly connected with
keyboard
100 Java does not handle Execution
execution by
___________ as keyword
101 Which of the following isReadOnly()
method is used to
determine whether a
database is read only or
not?
102 HTTP works on port 80
_______________-
103 DDL stands for? Data Definition Language
104 Which of the following CallableStatement
statement object is used
to execute stored
procedures?
AL-JUNAID INSTITUTE GROUP
105 Which of the following ava.io
package needs to be
import while handling
files>
106 Socket is a _________ bi-directional
communication channel
between hosts.
107 In Java, ______________ Three
types of statement objects
are available for sending
SQL queries to the
databases.
108 A port is a Client Address
______________ to
which processes can
listen for connections
request
109 Java is a ________ complicated
language

110 An applet can be defined A small program written in java and


as _________________ included in an HTML page

111 Based on functionality, Node stream and filter stream


the stream can be
categorized as
___________.

112 Bytecodes are created and Compiler


stored on disk
by________

113 Static methods can only Static variables and methods


access _____

114 Which of the following


classes provide
AL-JUNAID INSTITUTE GROUP
definitions
115 Which of the following Adapter class
classes provide
definitions for all
methods of their
corresponding listener
interface?
116 How many simultaneous 128K
connections can be open
using TCP and UDP
ports?
117 Strings in java are Reference data type
represented
as__________

118 In given lines of code Downcasting teacher to employee


Employee is a super type
class, Teacher is a child
class, ________ is
applying.
Employee e= new
Teacher();
119 The following is an Filter stream
example of _________,
FileReader fr= new
FileReader(“input.txt”);

120 Which of the following is Interface


called “pure abstract
class”?
121 setColor is a method of Graphics
___________ image?

122 If we want to call to super.toString()


String() method of parent
class in java. Which of
the following statement
AL-JUNAID INSTITUTE GROUP
will be used?
123 In order to include JPanel
graphics in your java
program, it is mandatory
to extend from
________class?
124 Mouse events can be All of given
trapped for ______ GUI
component?
125 What will happen is static None of the given options
modifier is removed from
the signature of main
method?
126 Windows, frames and Border layouts
dialogs use __________
as their default layout.
127 Exception handling code Catch block
is written in _____.

128 Suppose strings are store String element =


in a collection “arraylist”. (String)arraylist.get(i);
Get one string element
and store in element
variable. Choose correct
line of code for this
requirement?
129 Converting a bigger data
type into smaller data Down casting
type is called_______

130 Which of the following parseInt()


method is used to convert
a string into an int value?
131 Adapter class have been Action listener
defined for listener
interfaces except ______
interfaces.
AL-JUNAID INSTITUTE GROUP
132 Which of the following is Connection con =
correct java code driverManager.getconnection(conUR
statement that is used to L)
establish the connection?
133 Which of the following is a
general purpose container? JPanel

Which of the following java.io


134 package needs to be
import while handling
files?

135 Exception handling catch block


code is written in ___

136 Which of the following FileWriter


stream is a Node
stream?
137 Which of the following FileInputStream
stream read/write data
in the form of bytes?
138 Which of the following javac filename
command is used to
compile Java code?
139 Which of the following
method is used to executeUpdate(Sql);
execute INSERT,
UPDATE and Delete
SQL statements?
140 Which of the following BufferedReader
stream is a filter stream?
An event in java is
141 represented as ____ Object

142 Which of the following IOException


AL-JUNAID INSTITUTE GROUP
belongs to a category of
checked exception?
143 Packages are the way to
organize files into
different ------------- Directories
according to their
functionality, usability
as well as category they
should belong to.
144 When JSP page
compiled, it is translated Servlet
into?

You might also like