Java and SQL Programming Basics

Quiz covering Java programming concepts and SQL database commands

8 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which one is true ?

  1. A view can be created as a join on two or more tables
  2. A view can't be created as a join on two or more tables
  3. A view can't have an ORDER BY clause in SELECT statement
  4. A view can't be created with a GROUP BY clause in SELECT statement
Question 2 Multiple Choice (Single Answer)

You have dropped a table from where a VIEW was created . What would be the status of that VIEW

  1. View dropped also
  2. View becomes invalid
  3. View remains as it is
  4. View is accessible
Question 3 Multiple Choice (Single Answer)

The EMPLOYEE table contains info about employees. One of your employees got married , so her last name changed . What would be the command to reflect that change in the table ?

  1. UPDATE
  2. ALTER
  3. INSERT
  4. CREATE
Question 4 True/False

Java does not have multiple inheritance

  1. True
  2. False
Question 5 Multiple Choice (Single Answer)

To implement business Logic seperately and independently which MVC pattern should be used?

  1. MVC 1
  2. MVC 2
  3. MVC 3
  4. None
Question 6 True/False

Strings Are Immutable Objects

  1. True
  2. False
Question 7 Multiple Choice (Single Answer)

String x = new String("Life");System.out.println( x.length);

  1. 4
  2. 5
  3. Runtime Error
  4. Compiler Error
Question 8 Multiple Choice (Single Answer)

What is the output of following.

public static void main(String[]  args)  {
    int b=3;
    byte c=b/2;
    System.out.println("&c="+ &c);
}
  1. 1.5
  2. 1
  3. RuntimeException
  4. CompileTime Error