Home / Ravi Shankar / Programming MCQs Solution

Programming Portal Solution

You will find all Programming Portal MCQs whose solution is updated by Ravi Shankar

Q. Which of these class is related to all the exceptions that can be caught by using catch?

Q. What will be the output of the following Java code? class exception_handling { public static void main(String args[]) { try { int a = args.length; int b = 10 / a; System.out.print(a); try { if (a =

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

Q. In Java, which type of exceptions are unchecked at compile-time?

Q. What is the output of the following program code? public class Test{ public static void main(String args[]){ try{ int i; return; } catch(Exception e){ System.out.print(&quo

Q. Which of these keywords are used for the block to be examined for exceptions?

Q. Which of the following operators is used to generate instance of an exception which can be thrown using throw?

Q. Which of the following is a super class of all exception type classes?

Q. What is the result of the following code snippet? class Parent { int x = 10; } class Child extends Parent { int x = 20; void display() { System.out.println(super.x + " " + x); } } public class Main { public static void main(String[] args) { Child obj = new Child(); obj.display(); } }

Q. In Java, can a subclass access protected members (fields and methods) of its superclass?

Q. The concept of multiple inheritance is implemented in Java by I. Extending two or more classes. II. Extending one class and implementing one or more interfaces. III. Implementing two or more interfaces.

Q. Determine output: class Small{ public Small(){ System.out.print("a "); } } class Small2 extends Small{ public Small2(){ System.out.print("b "); } } class Small3 extends Small2{ public Small3(){ System.out.print(&q

Q. What will be the result of compiling and executing the following program code? class Vehicle{ public void printSound(){ System.out.print("vehicle"); } } class Car extends Vehicle{ public void printSound(){ System.out.print("car"); }

Q. Which two classes use the Shape class correctly? A. public class Circle implements Shape { private int radius; } B. public abstract class Circle extends Shape { private int radius; } C. public class Circle extends Shape { private int radius; public void draw(); } D

Q. Which of these is not a correct statement?

Q. Which of these type parameters is used for a generic class to return and accept any type of object?

Q. What will be the output of the following Java program? class X { int a; double b; } class Y extends X { int c; } class Output { public static void main(String args[]) { X a = new X(); Y b = new Y(); Class obj; obj = b.getClass(); System.out

Q. Which of these keywords is used to define packages in Java?

Q. In Java, can a class implement an interface and extend an abstract class simultaneously?

Q. What is the result of the following code snippet? abstract class MyAbstract { abstract void myMethod(); } class MyClass extends MyAbstract { void myMethod() { System.out.println("Implementation"); } public static void main(String[] args) { MyAbstract obj = new MyClass(); obj.myMethod(); }

Q. What is the result of the following code snippet? interface MyInterface { static void myMethod() { System.out.println("Static Method"); } } class MyClass implements MyInterface { public static void main(String[] args) { MyInterface.myMethod(); } }

Q. All methods must be implemented of an interface.

Q. Which one of the following is a class loader?

Q. What will be the output of the following Java program? class X { int a; double b; } class Y extends X { int c; } class Output { public static void main(String args[]) { X a = new X(); Y b = new Y(); Class obj; obj = b.getClass(); System.out

Q. Which of these class is used to create user defined exception?

Q. Which of these method returns a smallest whole number greater than or equal to variable X?

Q. Classes and Methods are stored in which space?

Q. Which of the following methods return the value as a double?

Q. Which of these can be used to fully abstract a class from its implementation?

Q. Which of these class have only one field 'TYPE'?

Q. What will be the output of the following Java program? class Output { public static void main(String args[]) { int x = 3.14; int y = (int) Math.abs(x); System.out.print(y); } }

Q. What will be the output? interface A{ public void method1(); } class One implements A{ public void method1(){ System.out.println("Class One method1"); } } class Two extends One{ public void method1(){ System.out.println("Class Two method1"); } } public class Test extends

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

Q. At line number 2 in the following code, choose 3 valid data-type attributes/qualifiers among "final, static, native, public, private, abstract, protected" public interface Status { /* insert qualifier here */ int MY_VALUE = 10; }

Q. What will be the output of the following Java code? class overload { int x; double y; void add(int a , int b) { x = a + b; } void add(double c , double d) { y = c + d; } overload() { this.x = 0; this.y = 0; }

Q. What is the purpose of an abstract method in an abstract class or interface?

Q. Which of the following can contain both abstract and non-abstract methods?

Q. Which function is used to perform some action when the object is to be destroyed?

Q. What is it called where object has its own lifecycle and child object cannot belong to another parent object?

Q. Which of these will happen if recursive method does not have a base case?

Q. Select from among the following character escape code which is not available in Java.

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

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

Q. What should be expression1 evaluate to in using ternary operator as in this line? expression1 ? expression2 : expression3

Q. Which of these statements is correct?

Q. In Java, which class is used to represent a sequence of characters as a string?

Q. What is the result of the expression "Hello".toUpperCase().toLowerCase() in Java?

Q. In Java, what is the purpose of the isEmpty() method of a String object?

Q. What will be the output of the following Java program? class output { public static void main(String args[]) { String s1 = "Hello"; String s2 = s1.replace('l','w'); System.out.println(s2); } }

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

Q. What will be the output of the following program code? class LogicalCompare{ public static void main(String args[]){ String str1 = new String("OKAY"); String str2 = new String(str1); System.out.println(str1 == str2); } }

Q. What will be the output of the following Java program? class output { public static void main(String args[]) { String a = "hello i love java"; System.out.println(a.indexOf('e')+" "+a.indexOf('a')+" "+a.lastIndexOf('l

Q. Which of these method of class String is used to extract more than one character at a time a String object?

Q. In the following Java code, what can directly access and change the value of the variable name? package test; class Target { public String name = "hello"; }

Q. What is the default initial value of numeric elements in an array of type int in Java?

Q. In Java, arrays are objects of which class?

Q. What is the purpose of the System.arraycopy() method in Java?

Q. Analyze the following code and choose the correct answer. int[] arr = new int[5]; arr = new int[6];

Q. Which access modifier restricts a class member's visibility only to the same class and its subclasses?

Q. What is the result of compiling and running the following code? class Base{ private Base(){ System.out.print("Base"); } } public class test extends Base{ public test(){ System.out.print("Derived"); } public s

Q. Choose the correct statement public class Circle{ private double radius; public Circle(double radius){ radius = radius; } }

Q. Determine output: public class Test{ int i = 34; public static void main(String args[]){ Test t1 = new Test(); Test t2 = new Test(); t1.i = 65; System.out.print(t1.i); System.out.print(t2.i); } }

Q. Which of the below data type doesn't support overloaded methods for +,-,* and /?

Q. What is the range of short data type in Java?

Q. The statement that makes changes to the global attributes of the database is . . . . . . . .

Q. What will be the output of the following MySQL statement? SELECT * FROM employee WHERE lname LIKE ‘_a%e%’;

Q. If emp_id contain the following set {-1, -2, 2, 3, -3, 1}, what will be the output on execution of the following MySQL statement? SELECT emp_id FROM person ORDER BY emp_id;

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

Q. What is the meaning of the "WHERE" clause in Mysql?

Q. What is the table name in the following SQL code? INSERT INTO student VALUES('Kyle','M',NULL);

Q. In Perl DBI, functions are called . . . . . . . .

Q. What does UTF stand for int utf8?

Q. Which system variable determines the number of rows from INSERT DELAYED statements that can be queued per table?

Q. The permitted value type for the variable 'character_set_client' is . . . . . . . .

Q. How many of the following can be used in stored procedures? PREPARE, EXECUTE, DEALLOCATE PREPARE

Q. CROSS JOIN and JOIN are similar to . . . . . . . .

Q. Which operator is used to access property of an object in PHP?

Q. What is AI in terms of database collation?

Q. In the following MySQL command how many rows will be deleted? DELETE person WHERE person_id=1; /*person_id is a primary key */

Q. Which is the join in which all the rows from the right table appear in the output irrespective of the content of the other table?

Q. Which statement is used to select a default database?

Q. Is there any error in the following MySQL statement? SELECT e.emp_id, e.fname,e.lname,d.name FROM employee AS e INNER JOIN department AS d ON e.dept_id=e.dept_id;

Q. Which option turns on the -extended-insert?

Q. What will be the output of the following MySQL statement? SELECT * FROM employee WHERE lname LIKE ‘F%’ AND lname LIKE ‘%T’;

Q. What will be the result of the following MySQL command? WHERE TITLE=’teller’ OR start_date=’2007-01-01’

Q. If the PIPES_AS_CONCAT is disabled, 'abc' || 'xyz' results in . . . . . . . .

Q. What does 'mysql_query()' return on failure?

Q. Which data directory subdirectory provides the information used to inspect the internal execution of the server at runtime.

Q. Which of the following statements is/are correct?

Q. MySQL does provides a date type that has an optional time part.

Q. Which of the following returns an SQLSTATE code?

Q. Which of the following use 'NULL' to indicate failure? mysql_init(), mysql_real_connect()

Q. What does the AUTO_INCREMENT sequences normally begin at?

Q. The statement used to change the table name is . . . . . . . .

Q. What is the role of "CONSTRAINS" in defining a table in Mysql?

Q. The indicator of presence or absence of a word in search is used in which mode?

Q. The default definer of an event is the user who . . . . . . . .

Q. What default value gets stored in columns of the table?

Q. Which statement is used to force the optimizer to use tables in a particular order?

Q. The property of InnoDB that enforces foreign key relationships stay intact is called . . . . . . . .

Q. If emp_id contain the following set {9, 7, 6, 4, 3, 1, 2}, what will be the output on execution of the following MySQL statement? SELECT emp_id FROM person ORDER BY emp_id;

Q. What will be the output of the following MySQL statement? SELECT * FROM employee WHERE lname LIKE %t%f%n%;

Q. Which data and time datatype stores time value in 'hh:mm:ss' format?

Q. mysql_store_result() does not return a result set.

Q. Is there any error in executing the following MySQL command? SELECT USER (), VERSION (), DATABASE ();

Q. What will be the output of the following SQL statement? SELECT * FROM person;

Q. To how many of the following does the prepared-statement API apply to? CREATE TABLE, DELETE, DO, INSERT

Q. Which grant table scope columns are case insensitive?

Q. Transactional processing provides strong guarantees about the outcome of operations.

Q. What performs administrative operations?

Q. Which mode tells not to cache query results?

Q. Which among the following belongs to an "aggregate function"?

Q. How many among the following use NULL to indicate failure? mysql_init(), mysql_real_connect()

Q. What does the term "NiFi Expression Language" refer to in Apache NiFi?

Q. How can you secure data transmission between nodes in a Hadoop cluster?

Q. What is the purpose of Hadoop's Ranger KMS (Key Management Service) in a Hadoop security setup?

Q. What is the primary function of Hadoop's Audit Logging?

Q. What is the role of Hadoop's Knox Gateway in a secure Hadoop environment?

Q. How can you secure communication between a Hadoop client and the ResourceManager using encryption?

Q. A float parameter, defaults to 0.0001f, which means we can deal with 1 error every . . . . . . . . rows.

Q. The web UI provides information about . . . . . . . . job statistics of the Hama cluster.

Q. . . . . . . . . was created to allow you to flow data from a source into your Hadoop environment.

Q. Which of the following format is similar to TCompactProtocol?

Q. Point out the correct statement.

Q. Point out the wrong statement.

Q. Point out the wrong statement.

Q. Drill is designed from the ground up to support high-performance analysis on the . . . . . . . . data.

Q. . . . . . . . . property allow users to override the expiry time specified.

Q. A . . . . . . . . represents a distributed, immutable collection of elements of type T.

Q. The Avros class also has a . . . . . . . . method for creating PTypes for POJOs using Avro's reflection-based serialization mechanism.

Q. Point out the correct statement.

Q. Point out the wrong statement.

Q. . . . . . . . . is a distributed machine learning framework on top of Spark.

Q. In HBase, what does the term "HBase Region Split" mean?

Q. In Oozie, what is the role of the Oozie Workflow XML file?

Q. What is Oozie in the context of Hadoop?

Q. HDT provides plugin for inspecting . . . . . . . . nodes.

Q. . . . . . . . . class allows other programs to get incoming chunks fed to them over a socket by the collector.

Q. . . . . . . . . is a query processing and optimization system for large-scale.

Q. Point out the wrong statement.

Q. Apache Knox provides . . . . . . . . REST API Access Point.

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

Q. What is the primary purpose of the Hive HDFS Storage Handler?

Q. Serialization of string columns uses a . . . . . . . . to form unique column values.

Q. In Hadoop, what is the primary role of the RecordReader?

Q. In Hadoop, what is the purpose of the Hadoop SequenceFileInputFormat?

Q. Point out the correct statement.

Q. . . . . . . . . are a way of encoding structured data in an efficient yet extensible format.

Q. . . . . . . . . typically compresses files to within 10% to 15% of the best available techniques.

Q. Which of the following is based on the DEFLATE algorithm?

Q. What is the role of the Pig Latin DUMP statement in Apache Pig?

Q. The . . . . . . . . class mimics the behavior of the Main class but gives users a statistics object back.

Q. A loader implementation should implement . . . . . . . . if casts (implicit or explicit) from DataByteArray fields to other types need to be supported.

Q. What is the purpose of the Hadoop ResourceManager "Fair Scheduler" in a Hadoop cluster?

Q. What is the significance of the Hadoop NameNode High Availability (HA) feature in HDFS?

Q. In Flume, what is the purpose of a Flume Channel?

Q. What is the purpose of the Flume Event Serializer in Flume?

Q. What is the role of the Flume Event Interceptor in Flume?

Q. Sqoop uses . . . . . . . . to fetch data from RDBMS and stores that on HDFS.

Q. ClobRef is a wrapper that holds a CLOB either directly or a reference to a file that holds the . . . . . . . . data.

Q. . . . . . . . . tool can list all the available database schemas.

Q. Point out the wrong statement.

Q. What is the primary function of the Reducer class in a MapReduce job?

Q. . . . . . . . . is a generalization of the facility provided by the MapReduce framework to collect data output by the Mapper or the Reducer.

Q. What is Apache ZooKeeper used for in Hadoop?

Q. Sun also has the Hadoop Live CD . . . . . . . . project, which allows running a fully functional Hadoop cluster using a live CD.

Q. What is the primary function of the MapReduce programming model in Hadoop?

Q. In the MapReduce programming model, what is the role of the Hadoop TaskTracker?

Q. What is the purpose of the MapReduce "Partitioner"?

Q. Running a . . . . . . . . program involves running mapping tasks on many or all of the nodes in our cluster.

Q. HDFS and NoSQL file systems focus almost exclusively on adding nodes to . . . . . . . .

Q. . . . . . . . . are highly resilient and eliminate the single-point-of-failure risk with traditional Hadoop deployments.

Q. What is the main function of the Hadoop Distributed File System (HDFS)?

Q. In Hadoop, what is the primary role of the ResourceManager in YARN?

Q. In Hadoop, what is the purpose of the Hadoop Distributed File System (HDFS)?

Q. In advanced MapReduce, what is the significance of the Hadoop Combiner class?

Q. What does the term "MapReduce locality optimization" refer to in advanced MapReduce?

Q. . . . . . . . . used by YARN framework which defines how any container launched and controlled.

Q. Point out the correct statement.

Q. the . . . . . . . .is a term commonly used in the programming world to describe the interface and environment that we use to create our applications.

Q. What happens when minimize box is set to true?

Q. Comparison operators are also termed as . . . . . . . .

Q. Class is defined using . . . . . . . .

Q. You use the . . . . . . . . tool to add a radio button to a form.

Q. vb is an . . . . . . . . in which one can develop, run, test & debug applications.

Q. . . . . . . . . format. In this format, the windows associated with the project will stay within a single container known as the parent. Code and form-based windows will stay within the main container form.

Q. What is wrong with the below statement?

Q. You use . . . . . . . . to include one or more menus on a Windows form.

Q. It is disadvantageous to use public variables in classes because . . . . . . . .

Q. One of its most important properties of lable is . . . . . . . .

Q. The . . . . . . . . in a pattern represents a single digit.

Q. Is there an error in the below code?

Q. The . . . . . . . . argument contains the message to display inside the dialog box.

Q. The items in a list box are sorted based on the . . . . . . . . characters in each item.

Q. Which of the following statements prevents a form from being closed?

Q. The . . . . . . . . keyword tells the computer to pass the variable's address rather than its contents.

Q. Static variable can only be used in the . . . . . . . . in which it is declared.

Q. Files that contain lines of text are known as . . . . . . . .

Q. Which of the following is the caption part for the following Visual Basic command?

Q. . . . . . . . . is used to check the condition with step by step by in this also we the condition more than one .

Q. In VB, array is divided into 3 types, the second type is . . . . . . . .

Q. . . . . . . . . method allows you to insert anywhere in the string.

Q. In VB, Standard modules and Class modules. provides three kind of property procedures but following not include in this

Q. Which of the following declares a five-element one-dimensional array?

Q. String comparison in Visual basic is case-sensitive.

Q. The . . . . . . . . constant instructs the computer to advance the insertion point to the next line in control.

Q. A label control's . . . . . . . . property determines whether the control automatically sizes to fit its current contents.

Q. Which is used to check both the conditions in a given if statement?

Q. . . . . . . . . is used to add a GroupBox to the interface.

Q. The . . . . . . . . keyword indicates that an application can set the property's value, but it cannot retrieve the value.

Q. Which of the following expressions evaluates to True when the strPart variable contains the string "123X45"?

Q. . . . . . . . . let's you perform SQL queries on your R data frames.

Q. Which control structure in R is used to execute a block of code repeatedly until a condition is met?

Q. Point out the correct statement?

Q. What will be the output of the following R code snippet? > g <- function(x) { + a <- 3 + x+a+y + ## 'y' is a free variable + } > g(2)