Home / Ritu Singhal / Programming MCQs Solution

Programming Portal Solution

You will find all Programming Portal MCQs whose solution is updated by Ritu Singhal

Q. What is the result of the following code snippet? try { throw new RuntimeException(); } catch (RuntimeException e) { System.out.println("Runtime Exception!"); } catch (Exception e) { System.out.println("Exception!"); }

Q. In Java, can a "try" block have multiple "catch" blocks?

Q. What will be the result of executing the following code? public class Test{ public void divide(int a, int b){ try{ int c = a / b; }catch(Exception e){ System.out.print("Exception "); }finally{ System.out.println("Finall

Q. Given the following piece of code: class SalaryCalculationException extends Exception{} class Person{ public void calculateSalary() throws SalaryCalculationException{ //... throw new SalaryCalculationException(); //... } } class Company

Q. What will be the output of the following Java code?

Q. What will be the output of the following Java code?

Q. What will be the result if NullPointerException occurs at line 2? try{ //some code goes here } catch(NullPointerException ne){ System.out.print("1 "); } catch(RuntimeException re){ System.out.print("2 "); } finally{ System.out.print("3"); }

Q. What will be the output of the following Java program? class A { int i; } class B extends A { int j; void display() { super.i = j + 1; System.out.println(j + " " + i); } } class inheritance { public static void main(String args[]) {

Q. Which of these Exceptions is thrown by loadClass() method of ClassLoader class?

Q. Which of these class holds a collection of static methods and variables?

Q. What will be the output of the following Java program? class Output { public static void main(String args[]) { String str = "TRUE"; boolean x = Boolean.valueOf(str); System.out.print(x); } }

Q. Which of the following is an incorrect statement about packages?

Q. What will be the output of the following Java code? class isinfinite_output { public static void main(String args[]) { Double d = new Double(1 / 0.); boolean x = d.isInfinite(); System.out.print(x); } }

Q. Which of these methods can be used to check whether the given value is a number or not?

Q. In Java, can an abstract class extend another class?

Q. Which of the following is a correct interface?

Q. Which of the following statements regarding abstract classes are true?

Q. Which of these classes encapsulate runtime environment?

Q. What will be the output of the following Java code? class Output { public static void main(String args[]) { Double i = new Double(257.578); int x = i.intValue(); System.out.print(x); } }

Q. Which of these coding techniques is used by method isDefined()?

Q. Which of the following constant are defined in Character wrapper?

Q. What will be the output of the following Java code? class Output { public static void main(String args[]) { Double i = new Double(257.578123456789); float x = i.floatValue(); System.out.print(x); } }

Q. Which keyword is used to declare a method that cannot be overridden in Java?

Q. In Java, can a method be overloaded by changing only the return type?

Q. What will be the output? class A{ static void method(){ System.out.println("Class A method"); } } class B extends A{ static void method(){ System.out.println("Class B method"); } } public class Test{ public static void main(String args[]){ A a = new B(); a.method();

Q. What will be the output of the following Java code? class overload { int x; int y; void add(int a) { x = a + 1; } void add(int a , int b) { x = a + 2; } } class Overload_methods { public static void main(String args[]) { ove

Q. What is a parameterized constructor in Java?

Q. The implicit return type of a constructor is

Q. What will be the output of the following Java code? class A { A()throws IOException { } } class B extends A { B() { } public static void main(String[]args) { } }

Q. When Overloading does not occur?

Q. Which operator is used for bitwise NOT in Java?

Q. What would be the output of the following code snippet if variable a=10?

Q. How do you convert a string to lowercase in Java?

Q. What is the purpose of the substring() method of a String object in Java?

Q. What is the purpose of the toLowerCase() method of a String object in Java?

Q. Determine output: public class Test{ public static void main(String args[]){ String str = null; if(str.length() == 0){ System.out.print("1"); } else if(str == null){ System.out.print("2");

Q. What will be the output of the following Java code? class output { public static void main(String args[]) { StringBuffer sb=new StringBuffer("Hello"); sb.replace(1,3,"Java"); System.out.println(sb); } }

Q. Which of these is an incorrect statement?

Q. What will be the output of the following Java code?

Q. toString() method is defined in

Q. A method within a class is only accessible by classes that are defined within the same package as the class of the method. Which one of the following is used to enforce such restriction?

Q. What will be the output after the following program is compiled and executed? public class Test{ public static void main(String args[]){ int x = 10; x = myMethod(x--); System.out.print(x); } static int myMethod(final int x){ return x--; } }

Q. Which of the following is a valid way to declare a constant in Java?

Q. What is the default value of a double variable in Java if it's not explicitly initialized?

Q. What is the output for the below code? public class Test{ public static void main(String[] args){ int i = 010; int j = 07; System.out.println(i); System.out.println(j); } }

Q. What will be the output of the following Java program? class dynamic_initialization { public static void main(String args[]) { double a, b; a = 3.0; b = 4.0; double c = Math.sqrt(a * a + b * b); System.out.println(c); } }

Q. An expression involving byte, int, and literal numbers is promoted to which of these?

Q. Which of these is an incorrect string literal?

Q. What will be the output of the following Java code? class asciicodes { public static void main(String args[]) { char var1 = 'A'; char var2 = 'a'; System.out.println((int)var1 + " " + (int)var2); } }

Q. Can we create an instance of Enum outside of Enum itself?

Q. The mysql client writes a record of executed statements to a history file on Unix.

Q. Which of the following is used on Solaris?

Q. Which table in INFORMATION_SCHEMA stores information about storage engines and server plugins?

Q. What does the expression '12 DIV 5? evaluate to?

Q. Illegal values converted to the appropriate 'zero' value for . . . . . . . .

Q. Which option executes all SQL statements in a SQL script irrespective of the number of errors?

Q. What is the significance of the statement "HAVING COUNT (emp_id)>2" in the following MySQL statement? SELECT d.name, COUNT (emp_id) emp_no FROM department d INNER JOIN Employee e ON d.dept_id=e.emp_id GROUP BY d.name HAVING COUNT (emp_id)>2

Q. In the database directory of the database each view and trigger object is associated with how many files?

Q. To reactivate indexes the command used is . . . . . . . .

Q. The columns containing a binary value that include null bytes will print properly using the %s printf() format specifier.

Q. Which clause is mandatory with clause "SELECT" in Mysql?

Q. Which clause is used to rename the existing table?

Q. Before MySQL 5.1.6 which privilege was required to create and drop triggers?

Q. Which table stores information about the threads executing within the server?

Q. Is it necessary to insert the value in each column of the table?

Q. Which mode of search is the search string parsed into words and the search looks for rows?

Q. What is the maximum number of characters allowed for a database name to have?

Q. What is the join where all possible row combinations are produced?

Q. What is xyz in the following MySQL statement? SELECT * FROM my_table WHERE MATCH(abc) AGAINST('xyz');

Q. Which of these returns a string containing an error message?

Q. The option that executes all SQL statements in a SQL script irrespective of the number of errors is . . . . . . . .

Q. Execution on a time activated basis according to a schedule is done by . . . . . . . .

Q. What does the expression '2 BETWEEN 2 AND 5' result in?

Q. To create or drop events for a database, which privilege should be granted?

Q. Which clause is used to remove a foreign key constraint?

Q. What is the clause that filters JOIN results called?

Q. The datatype INT stores . . . . . . . .

Q. The storage engine in MySQL that provides foreign key support is . . . . . . . .

Q. The recovery of data changes made since a given point in time is called . . . . . . . .

Q. Which variable is used as a handle to an open file?

Q. To disallow zero month or day parts in dates, the option used is . . . . . . . .

Q. In MySQL databases, the structure representing the organizational views of the entire databases is . . . . . . . .

Q. Which value will show an error when stored in float(4,2)?

Q. For which language is the PEAR module used?

Q. Encrypted connections can be established using . . . . . . . .

Q. Which system variable tells how far into the rest of each incomplete plan the optimizer should look to evaluate whether it should be expanded further?

Q. How is communication established with MySQL?

Q. Which among the following is the correct representation of "float(1,1)"?

Q. Find odd one out?

Q. Which operator is used to check the expression is not "NULL"?

Q. The variable used as a handle to an open file is . . . . . . . .

Q. To perform consistency checks on a MyISAM table the statement is . . . . . . . .

Q. The locking statements LOCK TABLES and UNLOCK TABLES are not permitted in stored routines.

Q. The TRIGGER privilege is used for the table to be able to create and drop triggers for it.

Q. A binary string is not associated with a character set.

Q. What is the property of InnoDB that enforces foreign key relationships stay intact?

Q. Select the sequence for how the query mechanism works?

Q. What can be used interchangeably with MYSQL_VERSION_ID?

Q. In which file are the statements entered in 'mysql' saved?

Q. Consider a database name "db_name" whose attributes are intern_id (primary key), subject. Intern_id = {1, 2, 3, 4, 5, 6} Subject = {sql, oop, sql, oop, c, c++} If these are one to one relation then what will be the output of the following MySQL statement? SELECT intern_id FROM db_name WHER

Q. A popular presentation program for Windows and Mac in Microsoft Office is

Q. What is the significance of NiFi's "SplitText" processor?

Q. What is the purpose of NiFi's "ConvertRecord" processor?

Q. What is the significance of NiFi's "UpdateAttribute" processor in a data flow?

Q. What is the role of Hadoop's HDFS Encryption Zone in terms of security?

Q. The HCatalog . . . . . . . . supports all Hive DDL that does not require MapReduce to execute.

Q. A . . . . . . . . in a social graph is a group of people who interact frequently with each other and less frequently with others.

Q. . . . . . . . . uses memory for I/O in Thrift.

Q. . . . . . . . . is a human-readable text format to aid in debugging.

Q. What is the primary purpose of the HBase Bloom Filters?

Q. What is the significance of the HBase ZooKeeper integration?

Q. In HBase, what is the primary function of the HBase Increment Column Value?

Q. In HBase, what does the term "HBase Data Block" refer to?

Q. What is the role of the Oozie Coordinator EL functions in a coordinator workflow?

Q. . . . . . . . . are the Chukwa processes that actually produce data.

Q. Point out the wrong statement.

Q. In Hive, what is the significance of the WHERE clause in a SELECT statement?

Q. HBase supports a . . . . . . . . interface via Put and Result.

Q. Apache HBase is a non-relational database modeled after Google's . . . . . . . .

Q. What is the function of the Hadoop MultipleOutputs class?

Q. . . . . . . . . are used between blocks to permit efficient splitting of files for MapReduce processing.

Q. Point out the correct statement.

Q. We can declare the schema of our data either in a . . . . . . . . file.

Q. Avro schemas describe the format of the message and are defined using . . . . . . . .

Q. What is the primary role of the Pig UDF (User Defined Function)?

Q. What is Apache Pig in the context of Hadoop?

Q. Which of the following will run pig in local mode?

Q. The loader should use . . . . . . . . method to communicate the load information to the underlying InputFormat.

Q. Which of the following is an entry in jobconf?

Q. In Hadoop, what is the purpose of the Hadoop ResourceManager "Node Decommissioning" feature?

Q. In Hadoop, what is the role of the Hadoop ResourceManager "Resource Profiles" feature?

Q. Which of the following is a configuration management system?

Q. In Sqoop, what does the term "Import" refer to?

Q. What is the primary function of the Flume Channel Selector in Flume?

Q. Helprace is using ZooKeeper on a . . . . . . . . cluster in conjunction with Hadoop and HBase.

Q. The . . . . . . . . znode is used for synchronizing the changes made to the _acl_ table by the grant/revoke commands.

Q. ZooKeeper's architecture supports high . . . . . . . . through redundant services.

Q. Authorization capabilities for Cassandra use the familiar . . . . . . . . security paradigm to manage object permissions.

Q. Point out the wrong statement.

Q. Hadoop is a framework that works with a variety of related tools. Common cohorts include . . . . . . . .

Q. What does the term "Combiner" represent in the context of MapReduce?

Q. Point out the wrong statement.

Q. Mapper implementations are passed the JobConf for the job via the . . . . . . . . method.

Q. What is the core storage layer in the Hadoop architecture?

Q. In Hadoop architecture, what is the function of the Hadoop NameNode?

Q. What is the primary function of the Hadoop MapReduce "Secondary Sort"?

Q. . . . . . . . . is an input format for reading data from a relational database, using JDBC.

Q. An . . . . . . . . is responsible for creating the input splits, and dividing them into records.

Q. Point out the wrong statement.

Q. The functions header and footer contains the . . . . . . . . keyword.

Q. How is a default button designated?

Q. In VB, . . . . . . . . is used to enter the more then one value in a single variable having same data types.

Q. VB is an . . . . . . . ..

Q. What will be contained in Msg if grade entered by user is 'd'?

Q. Which is used to change the name of the picture?

Q. The . . . . . . . . and . . . . . . . . buttons are examples of many button controls found in Windows applications.

Q. The main property of Image Control is stretchable,

Q. If you want text to appear to the left of the selected image control on a Web form, you would need to click which button in thePosition dialog box?

Q. Letter . . . . . . . . is the Exit menu's access key.

Q. You should assign access keys to each of the control in the interface that contain . . . . . . . .

Q. . . . . . . . . is a variable that remains in memory, and retains its value even after the procedure declaring it ends.

Q. Which property contains a number that represents the order in which the control was added to the form?

Q. . . . . . . . . in the syntax gives the format you want to use.

Q. The condition must be a . . . . . . . . expression.

Q. If the txtPrice control contains the value 75, what value will the variable=Decimal.TryParse (txtPrice.Text,decPrice) method return?

Q. The . . . . . . . . is used to concat to Strings.

Q. The intSales array is declared as follows: Dim intSales() As Integer = {10000, 12000, 900, 500, 20000}. Which of the following loops will correctly add 100 to each array element? The intSub variable contains the number 0 before the loops are processed.

Q. The property values of the shape control are 0, 1, and 2,3,4,5 which will make it appear as a rectangle, a square, an oval shape, a circle, a rounded rectangle and a rounded square respectively.

Q. Variables are used to temporarily store data during execution of application.

Q. Which of the following returns a value after performing its specific task in Visual Basic?

Q. The position of an item in a list box depends on the value stored in the list box's . . . . . . . .

Q. Microsoft ActiveX Data Control 6 is insert from component , it is used to load ADO control.

Q. What will be assigned to the dblAvg variable after the code has been executed? The intTotal, intSub, and dblAvg variables contain the number 0 before the loops are processed.

Q. The . . . . . . . . indicates the purpose of the menu element.

Q. In VB, the. . . . . . . . is the function that computes the square root of a number.

Q. What is the comparison operator to find if two values are equal?

Q. Which of the following is a principle of analytic graphics?

Q. In R, what is the role of the ifelse() function?

Q. Unlike filters queries can be saved as in a database ?

Q. ROLLBACK in a database is ________ statement ?

Q. The most common subtotal used Subtotals command is the function, which causes Excel to display a sum each time the control field change ?

Q. Each excel file is called a work book because ?

Q. The view that puts a blue line around each page that would be printed is the ...... ?

Q. The advantage of using a spreadsheet is ?

Q. You can create only a horizontal page break by first selecting ?

Q. When you are typing an equation into a cell the first thing that must be entered is ?

Q. When the formula bar is active, you can see ?

Q. Which of the following is a popular DOS based spreadsheet package ?

Q. You can use the format painter multiple times before you turn it off by ?

Q. You can print only an embedded chart by ?