VU Grand Quiz

CS506 Solved Grand Quiz Spring 2021

Welcome to CS506 Grand Quizzes at VUExamGuide.com – your ultimate destination for 100% Correct Answers! If you are a CS506 student at VU, looking for a reliable study resource to excel in your quizzes and exams, you’ve come to the right place.

Our CS506 Grand Quizzes cover a wide range of topics, meticulously prepared by our expert team to ensure accuracy and depth of understanding. With a focus on Web Design and Development, these quizzes will enhance your knowledge and problem-solving skills in creating dynamic and interactive websites.

No more struggling with complex coding challenges or uncertain solutions! VUExamGuide.com empowers you to excel in CS506. Embrace the knowledge and skills you need to become a proficient web developer and create cutting-edge web applications.

Join us now and embark on a journey of academic excellence with CS506 Grand Quizzes. Prepare to shine and propel yourself towards a brighter future – start exploring VUExamGuide.com today!

Welcome to CS506 Grand Quizzes at VUExamGuide.com – your ultimate destination for 100% Correct Answers! If you are a CS506 student at VU, looking for a reliable study resource to excel in your quizzes and exams, you’ve come to the right place.

Our CS506 Grand Quizzes cover a wide range of topics, meticulously prepared by our expert team to ensure accuracy and depth of understanding. With a focus on Web Design and Development, these quizzes will enhance your knowledge and problem-solving skills in creating dynamic and interactive websites.

No more struggling with complex coding challenges or uncertain solutions! VUExamGuide.com empowers you to excel in CS506. Embrace the knowledge and skills you need to become a proficient web developer and create cutting-edge web applications.

Join us now and embark on a journey of academic excellence with CS506 Grand Quizzes. Prepare to shine and propel yourself towards a brighter future – start exploring VUExamGuide.com today!

CS506 SOLVED MCQs

Sr.NOMCQS QUESTIONS:ANSWER:
1FTP (File Transmission Protocol) works on _____________ port.    21
2Which of the following is NOT true for java inner classes?Generally used as public utility classes
3Which statement from the following statements is true about java Anonymous Inner class(A) It is difficult to understand (B) It has no name (C) it is much shorter Answer:(D) All of the given options
4While running following ExceptionExample.java class on command line without passing command line arguments gives ________ exception. public class Exception Example { public static void main (String args[]){ System.out.println(args[0]); }}      Array index out of bound exception
5Exception handling code is written in ______.catch block
6Let suppose a column has index 5 in the ResultSet object. Which of the following statement is used to retrieve the column values?String name=rs.getString(5)
7Which of the following streams is a byte oriented stream?FileInputStream
8Which of the following statements is true about primitive data types and reference data types?Primitive data types are created on stack whereas references are created on heap
9Which command of the following commands is used to compile “Java Test” java file’s code?javac JavaTest.java
10Which of the following statements is true regarding paintComponent() method?It first paints the background and then performs custom painting.
11WindowListener interface contains ________ methods.Seven
12HashMap takes key as a/an ________Object
13Adapter classes have been defined for listener interfaces except _________ interface.    ActionListener
14Interface imposes _____________ structure on any class that uses interfacedesign
15Which of the following is NOT true about paintComponent() method?Tells the components border (if any) to paint.
16An object of Student.java class is creating and setting its value in Test.java class __________ error is there in given code. public class Test{  public static void main (String args[]){      Student s2 = new Student();      s2->setName(“Aslam”);   } }      setName method should not be accessed by arrow operator
17The “MouseDragged” and “mouseMoved” method are defined in _________ interface.MouseMotionListner
18previous() is a method of __________ object.ResultSet
19Which of the following driver type(s) has better performance than other?Type 4: Native – protocol /all – java driver
20For a programmer the event handling is a three step process in term of code. Which of the following is NOT an event handling step?  Publish event
21Which feature of the following features does Java provide?Function Overriding
22What will happen if static modifier is removed from the signature of main method?The program will compile but not run.
23Bytecodes are put in memory by ____________.class loader
24Which of the following is the correct syntax to make a PersonInfo class into a Serializable classPublic class PersonInfo implements Serializable {/*class body*/}
25The following code creates and starts a timer that fires an action event once per ________   Timer t = new Timer (1000,this); t.start();    Second
26CmdArgs java class is compiled. If the command “java CmdArgs CS506” run in cmd, then what will be output of given code.   Public class CmdArgs{   public static void main (String[]args){   System.out.println(“First argument” + args[0]); } }        CS506
27Which of the following functions is declared in MouseMotionListener interface?public void mouseDragged(MouseEvent me);
28Which of the following classes provide definitions for all the methods (empty bodies) of their corresponding Listener interface?  adapter classes
29What will happen if main method is declared as private?The program will throw an exception at run time
30To make sure array accesses touch only the memory allocated to them. JVM does _________checking at runtime.  dynamic
31What will happen if static modifier is removed from the signature of main method?The program will compile but not run
32Which of the following is NOT true for java inner classes?Generally used as public utility classes
33A hash map object is to create, to store Teacher objects as values and their CNIC in the form of strings as keys. Which syntax is correct for this requirement?HashMap <String,Teacher> h =new HashMap<String, Teacher>();
34A scrollable and updatable ResultSet object has the following capabilities except______    insert new columns
35Which of the following classes is capable to instantiate?Concrete class
36Which of the following objects is passed as an argument to paintComponent()method?Graphics object
37It is verified by __________ that not all bytecodes violate java security restrictions.bytecode verifier
38An event in java is represented as ___________.  Object
39In given lines of code ____________________ is applying. double a = 9.5; int b = (int) a;  downcasting a to b type
40Which of the given will clear all the previous painting?super.paintCompnent()
41The following is an example of _________. FileReader fr = new FileReader(“input.txt”);Node stream
42Strings in java are represented as _________.  Reference data types
43AWT is also called ______.  Heavy weight components
44Choose the correct syntax to define an interface named as “Speaker” in java language.  public interface Speaker{}
45In Java, if a super class method is protected then overriding method ___________.    may be either protected or public
46Timer class constructor requires time in____ .milli seconds
47The ___________ is directly connected with keyboard.Node stream
48For each class contained in java source file, compiler generates _________ class file/s.one
49In given lines of code ____________________ is applying. int a = 20; double b = a;  upcasting a to b type
50Which of the following methods is called only once during the life cycle of an Applet?destroy()
51If there is a class “Student”, then the java files must be saved with ________ name.  Student.java
52Which of the following statement object is used to execute simple SQL statement?Statement
53Which feature of the following featured is not included in Java language?Pointer manipulation
54Which of the following methods is used to convert a string into an int value?ParseInt()
55Which of the following is a valid variable name in Java?NumberOfStudent
56Which of the following features is available in java?Primitive data types
57A port is a __________________ to which processes can listen for connections request.Transport Address
58Which of the following is called “pure abstract class”?Interface
59Which of the following packages needs to import while handling files?java.io
60How many simultaneous connections can be opened using TCP and UDP ports?128k
61Which of the following statements is a correct statement for “mouse release” event in “MouseListener” interface?  public void mouseReleased(MouseEvent me)
62______________ is/are not part of java core language.ArrayList class
63Strings in java are represented as ___________.    Reference data types
64________________ in a collection class creates a collection with no elements.Constructor
65== operator compare ____________ of strings whereas equals() method compare ________ of strings.  Addresses, values
66Assume that we do not want to serialize phoneNum attribute of Personinfo class, this can be done by;    transient String phoneNum;
67java program’s code is compiled into a form calledByte code
68Which command of the following commands is used to run “Java Test” Java file’s program?  java JavaTest
69Java defines ___________ for the listener interfaces having more than one event handling methods.  Adapter classes
70You must include a ______________ to declare an exception that might be thrown to another method.  throws-clause
71If you want to animate something like ball, moving from one place to another, we constantly need to call paint () method.  False
72In the context of Java Graphics, which of the following we should override while painting?paintComponet()
73Which of the following features is not available in Java?Multiple inheritance
74If a JPanel has a triangle drwan on it which of the following method will display it?paintComponet()
75Which of the following is correct java code statement that is used to establish the connection?Connection con = DriverManager.getConnection(conURL)
76Which of the following exception belongs to a category of checked exception?IOException
77A collection can store _____________.  Heterogeneous objects
78Which of the following statement object is used to execute precompiled SQL statements?  PreparedStatment
79Which of the following stream read/write data in the form of bytes?FileInputStream
80Which of the following method is used to execute INSERT, UPDATE and DELETE SQL statementsexecuteUpdate(sql);
81HashMap takes key as a/an _____Object
82ArrayList is an example of ___________ collection typeSequence Based
83If we want to animate something like ball, moving from one place to another, we constantly need to call paint () method.False
84Which of the following is a general purpose container?JPanel
85ResultSet provides various gathers to retrieve ________________.Data of the column
86In editor java programs are created while stored on/in ________________.Disk
87If a class needs to handle event generated by button then which of the following interface a class needs to implement?ActionListner
88Which of the following classes provide definitions for all the methods (empty bodies) of their corresponding Listener interfaceAdapter Classes
89Which of the following is called “pure abstract class”Interface
90A default ResultSet object has a cursor that __________________-.Moves Forward Only
91Which of the given will clear all the previous painting?super.paintComponent()
92Which of the following is NOT a method of ResultSet object?executeQuery(sql)
93Java defines _________ for the listener interfaces having more than one event handling methodsAdapter Classes
94Which of the following feature is not included in Java?addFocusListener
95All AWT and swing component generate eventsTrue
96___________________ is/are not part of jaca code languageArrayList class
97The collection API are defined in ___________ package.Java.util
98Which of the following statement object is used to execute precompiled SQL statements?PreparedStatement
99The _____________ is directly connected with keyboardNode stream
100Java does not handle execution by ___________ as keywordExecution
101Which of the following method is used to determine whether a database is read only or not?isReadOnly()
102HTTP works on port _______________-80
103DDL stands for?Data Definition Language
104Which of the following statement object is used to execute stored procedures?CallableStatement
105Which of the following package needs to be import while handling files>ava.io
106Socket is a _________ communication channel between hosts.bi-directional
107In Java, ______________ types of statement objects are available for sending SQL queries to the databases.Three
108A port is a ______________ to which processes can listen for connections requestClient Address
109    Java is a­­ ­­­­________ languagecomplicated
110  An applet can be defined as _________________A small program written in java and included in an HTML page  
111Based on functionality, the stream can be categorized as ___________.  Node stream and filter stream
112Bytecodes are created and stored on disk by________  Compiler
113  Static methods can only access _____  Static variables and methods
114Which of the following classes provide definitions 
115Which of the following classes provide definitions for all methods of their corresponding listener interface?Adapter class
116How many simultaneous connections can be open using TCP and UDP ports?128K
117Strings in java are represented as__________  Reference data type
118In given lines of code Employee is a super class, Teacher is a child class, ________ is applying. Employee e= new Teacher();Downcasting teacher to employee type
119The following is an example of  _________, FileReader fr= new FileReader(“input.txt”);  Filter stream
120Which of the following is called “pure abstract class”?Interface
121setColor is a method of ___________ image?  Graphics
122If we want to call to String() method of parent class in java. Which of the following statement will be used?super.toString()
123In order to include graphics in your java program, it is mandatory to extend from ________class?JPanel
124Mouse events can be trapped for ______ GUI component?All of given
125What will happen is static modifier is removed from the signature of main method?None of the given options
126Windows, frames and dialogs use __________ as their default layout.Border layouts
127Exception handling code is written in _____.  Catch block
128Suppose strings are store in a collection “arraylist”. Get one string element and store in element variable. Choose correct line of code for this requirement?String element = (String)arraylist.get(i);
129Converting a bigger data type into smaller data type is called_______    Down casting
130Which of the following method is used to convert a string into an int value?parseInt()
131Adapter class have been defined for listener interfaces except ______ interfaces. Action listener
132Which of the following is correct java code statement that is used to establish the connection?Connection con = driverManager.getconnection(conURL)
133  Which of the following is a general purpose container?                                 JPanel  
  134 Which of the following package needs to be import while handling files?  java.io
135Exception handling code is written in ___  catch block
136Which of the following stream is a Node stream?FileWriter  
137Which of the following stream read/write data in the form of bytes?FileInputStream
138Which of the following command is used to compile Java code?javac filename
139Which of the following method is used to execute INSERT, UPDATE and Delete SQL statements?          executeUpdate(Sql);  
140Which of the following stream is a filter stream?BufferedReader
  141An event in java is represented as ____                                       Object  
142Which of the following belongs to a category of checked exception?IOException
143Packages are the way to organize files into different ————-according to their functionality, usability as well as category they should belong to.                       Directories  
144When JSP page compiled, it is translated into?                      Servlet  

Leave a Reply

Your email address will not be published. Required fields are marked *