cs506 quize no. 1 (26-04-2012) Solved
1st quize attempt four persons
Question # 1 of 15 ( Start time: 07:13:33 PM ) Total Marks: 1
Which of the following syntax attaches an output stream to console?
Select correct option:
1. FileWriter fw = new FileWriter(“output.txt”);
2. FileWriter fw = new FileWriter(FileDescriptor.out);
3. FileWriter fw = new FileWriter(FileDescriptor.in);
4. FileWriter fw = new FileWriter(FileDescriptor);
Question # 2 of 15 ( Start time: 07:15:04 PM ) Total Marks: 1
What will happen if static modifier is removed from the signature of main method?
Select correct option:
1. The program does not compile
2. The program compiles and runs successfully
3. The program compiles but does not run
4. None of given options
Question # 3 of 15 ( Start time: 07:15:38 PM ) Total Marks: 1
v What will happen if main method is declared as private?
Select correct option:
1. The program does not compile
2. The program throws an exception at run time
3. The program compiles and runs successfully
4. None of given options
Question # 4 of 15 ( Start time: 07:17:01 PM ) Total Marks: 1
A collection can store _________
Select correct option:
1. Homogenous objects
2. Heterogeneous objects
3. Objects as well as primitive values
4. At most 100 objects
Question # 5 of 15 ( Start time: 07:17:39 PM ) Total Marks: 1
The toString() method returns a _________ representation of _______
Select correct option:
1. int, string
2. string, int
3. string, object
4. object, string
Question # 6 of 15 ( Start time: 07:18:58 PM ) Total Marks: 1
Based on functionality, the streams can be categorized as ________
Select correct option:
1. Byte oriented stream and Node stream
2. Filter stream and Character oriented stream
3. Node stream and Filter stream
4. Byte oriented stream and Character oriented stream
Question # 7 of 15 ( Start time: 07:20:18 PM ) Total Marks: 1
Which of the following stream read/write data in the form of bytes?
Select correct option:
1. FileReader
2. FileWriter
3. PrintWriter
4. FileInputStream
Question # 8 of 15 ( Start time: 07:20:57 PM ) Total Marks: 1
If a super class method is protected then overriding method _________
Select correct option:
1. must be protected
2. must be public
3. must be private
4. may be either protected or public
Quiz Start Time: 07:13 PM Time Left 81
sec(s)
Question # 9 of 15 ( Start time: 07:22:10 PM ) Total Marks: 1
A variable declared as static in a class is a/an _________
Select correct option:
1. Instance variable
2. Class variable
3. Const variable
4. Global variable
Question # 11 of 15 ( Start time: 07:23:25 PM ) Total Marks: 1
Which of the following stream read/write data in the form of bytes?
1. FileReader
2. FileWriter
3. PrintWriter
4. FileInputStream
Question # 12 of 15 ( Start time: 07:24:43 PM ) Total Marks: 1
HahMap takes key as a/an _________
1. Object
2. Array
3. Primitive value
4. Function
Question # 13 of 15 ( Start time: 07:25:40 PM ) Total Marks: 1
Which of the following feature is not available in java
1. Pointers
2. Operator overloading
3. Global variables
4. All of given options
Question # 14 of 15 ( Start time: 07:26:23 PM ) Total Marks: 1
Static methods can only access __________
1. Instance variables
2. Instance methods
3. Static variables and methods
4. Both static and instance members
Question # 15 of 15 ( Start time: 07:27:23 PM ) Total Marks: 1
What will happen if we write static public void instead of public static void?
Select correct option:
1. Program does not compile
2. Program compiles but does not run
3. Program compiles and run successfully
4. Program throws an exception
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 1 of 15 ( Start time: 09:49:46 PM )
|
Total Marks: 1
|
Which of the following method is used to convert a string into an int value?
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 2 of 15 ( Start time: 09:50:29 PM )
|
Total Marks: 1
|
The classes which contain the word _____ in their name are byte oriented streams.
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 3 of 15 ( Start time: 09:50:55 PM )
|
Total Marks: 1
|
Which of the following command is used to compile Java code?
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 4 of 15 ( Start time: 09:51:16 PM )
|
Total Marks: 1
|
The given line of code will result in ________ System.out.println(5+9);
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 5 of 15 ( Start time: 09:51:43 PM )
|
Total Marks: 1
|
The classes which contain the word _____ are byte oriented streams.
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 6 of 15 ( Start time: 09:52:32 PM )
|
Total Marks: 1
|
Which of the following stream is a filter stream?
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 7 of 15 ( Start time: 09:53:41 PM )
|
Total Marks: 1
|
A collection can store _________
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 8 of 15 ( Start time: 09:54:03 PM )
|
Total Marks: 1
|
A variable declared as static in a class is a/an _________
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 9 of 15 ( Start time: 09:54:29 PM )
|
Total Marks: 1
|
Which of the following stream read/write data in the form of bytes?
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 10 of 15 ( Start time: 09:55:02 PM )
|
Total Marks: 1
|
The collection API are defined in _______ package.
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 11 of 15 ( Start time: 09:56:13 PM )
|
Total Marks: 1
|
The keyword this is used to ________
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 12 of 15 ( Start time: 09:57:41 PM )
|
Total Marks: 1
|
All the exceptions and errors in java are inherited from _____ class.
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 13 of 15 ( Start time: 09:57:58 PM )
|
Total Marks: 1
|
Which of the following feature is not available in java?
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 14 of 15 ( Start time: 09:58:18 PM )
|
Total Marks: 1
|
Which of the following syntax is used to attach an input stream to console?
|
Select correct option:
|
|
|
|
|
|
MC100205815 : Saira Qamar
Quiz Start Time: 09:49 PM
|
|
|
Question # 15 of 15 ( Start time: 09:59:27 PM )
|
Total Marks: 1
|
Which of the following syntax attaches an output stream to console?
|
Select correct option:
|
|
|
|
|
|
MC090406635 : Muqaddas Bano
Quiz Start Time: 05:01 PM Time Left 89
sec(s)
Question # 1 of 10 ( Start time: 05:01:47 PM ) Total Marks: 1
Which of the following is a top level container?
Select correct option:
JPanel
ToolBar
ScrollPane
Dialog
MC090406635 : Muqaddas Bano
Quiz Start Time: 05:01 PM Time Left 87
sec(s)
Question # 2 of 10 ( Start time: 05:03:10 PM ) Total Marks: 1
Which of the following stream is a Node stream?
Select correct option:
PrintWriter
FileWriter
BufferedReader
All of given option
MC090406635 : Muqaddas Bano
Quiz Start Time: 05:01 PM Time Left 77
sec(s)
Question # 3 of 10 ( Start time: 05:04:25 PM ) Total Marks: 1
JPanel and Applet use ________ as their default layout.
Select correct option:
Flow layout
Border layout
Grid layout
GridBag layout
MC090406635 : Muqaddas Bano
Quiz Start Time: 05:01 PM Time Left 65
sec(s)
Question # 4 of 10 ( Start time: 05:04:46 PM ) Total Marks: 1
Which of the following feature does Java provide?
Select correct option:
Operator Overloading
Pointers
Overriding
Multiple Inheritance
MC090406635 : Muqaddas Bano
Quiz Start Time: 05:01 PM Time Left 89
sec(s)
Question # 5 of 10 ( Start time: 05:06:15 PM ) Total Marks: 1
Which of the following is used for inheritance in java?
Select correct option:
implements
extends
: (colon)
inherit
MC090406635 : Muqaddas Bano
Quiz Start Time: 05:01 PM Time Left 89
sec(s)
Question # 6 of 10 ( Start time: 05:06:40 PM ) Total Marks: 1
What will happen if main method is declared as private?
Select correct option:
The program does not compile
The program throws an exception at run time
The program compiles and runs successfully
None of given options
MC090406635 : Muqaddas Bano
Quiz Start Time: 05:01 PM Time Left 89
sec(s)
Question # 7 of 10 ( Start time: 05:07:51 PM ) Total Marks: 1
Which of the following statement object is used to execute simple SQL statement?
Select correct option:
Statement
PreparedStatement
CallableStatement
None of given
MC090406635 : Muqaddas Bano
Quiz Start Time: 05:01 PM Time Left 90
sec(s)
Question # 8 of 10 ( Start time: 05:09:02 PM ) Total Marks: 1
The given line of code will result in ________ System.out.println(5+9);
Select correct option:
59
5+9
14
Syntax error
MC090406635 : Muqaddas Bano
Quiz Start Time: 05:01 PM Time Left 89
sec(s)
Question # 9 of 10 ( Start time: 05:10:29 PM ) Total Marks: 1
Which of the following syntax attaches an output stream to console?
Select correct option:
FileWriter fw = new FileWriter(“output.txt”);
FileWriter fw = new FileWriter(FileDescriptor.out);
FileWriter fw = new FileWriter(FileDescriptor.in);
FileWriter fw = new FileWriter(FileDescriptor);
MC090406635 : Muqaddas Bano
Quiz Start Time: 05:01 PM Time Left 89
sec(s)
Question # 10 of 10 ( Start time: 05:11:41 PM ) Total Marks: 1
Which of the following is true about abstract class?
Select correct option:
An abstract class must have all methods declared as abstract methods.
A class must have at least one abstract method to be an abstract class.
A class without any abstract method can be declared as abstract class.
An instance of abstract class can be created.