0% found this document useful (0 votes)
70 views16 pages

1

The document contains 13 questions related to Java fundamentals, inheritance, polymorphism and Oracle SQL topics like aggregate functions, DDL and DML. The questions cover concepts like data types, class relationships, method overriding and database functions. Multiple choice options are given for each question to test knowledge of basic Java and SQL concepts.

Uploaded by

leelu_p
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views16 pages

1

The document contains 13 questions related to Java fundamentals, inheritance, polymorphism and Oracle SQL topics like aggregate functions, DDL and DML. The questions cover concepts like data types, class relationships, method overriding and database functions. Multiple choice options are given for each question to test knowledge of basic Java and SQL concepts.

Uploaded by

leelu_p
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

/w EPDw UJNzU0O

53
52:51
Topic : GF_JAVA_JAN10 Sub Topic : Java Fundamentals
Question 1 Topic:Java,Sub-Topic:Java Fundamentals

Consider the following code:


class Acc_IO1{
public static void main(String a[]){
int ascii;
ascii = 'a';
System.out.write(ascii);
}
}
What will be the output of above code?
Choose most appropriate option.'
a. 97
b. a
c. 98
d. b
e. None of the above
Topic : GF_Oracle_Jan10 Sub Topic : Constraint
Question 2 Topic:Oracle,Sub-Topic:SQL

Which of the clause is used to check a list of values in a column ?

Choose most appropriate option.


a. EXISTS
b. IN
c. AND
d. NOT

Topic : GF_Oracle_Jan10 Sub Topic : Constraint


Question 3 Topic:Oracle,Sub-Topic:SQL

The EMP table is currently empty. Which of the following query is used to modify EMP
table to add a primary key on EMPID column ?

Choose most appropriate option


a. ALTER TABLE emp MODIFY CONSTRAINT emp_id_pk PRIMARY KEY
(empid);
b. ALTER TABLE emp ADD CONSTRAINT emp_id_pk PRIMARY KEY (empid);
c. ALTER TABLE emp ADD CONSTRAINT emp_id_pk PRIMARY KEY empid;
d. ALTER TABLE emp ADD PRIMARY KEY empid;
e. ALTER TABLE emp ADD CONSTRAINT PRIMARY KEY (empid);
Topic : GF_Oracle_Jan10 Sub Topic : DDL
Question 4 Topic:Oracle,Sub-Topic:SQL

You create a table but then subsequently realize you need a few additional columns. To add
those new columns later, which of the following command is used for the above query.

Choose most appropriate option


a. CREATE OR REPLACE TABLE
b. ALTER TABLE
c. CREATE TABLE
d. TRUNCATE TABLE

Topic : GF_JAVA_JAN10 Sub Topic : Classes and Objects


Question 5 3 Topic : JAVA, Sub-Topic : Classes and Objects

Consider the following code:

public class Know {


public static void main(String[] args) {
String string = "Accenture";
Object object = string;
if (object.equals(string)){
System.out.print("1"); }
else { System.out.print("2"); }
if (string.equals(object)){
System.out.print("3"); }
else { System.out.print("4"); }
}
}
What will be the output of above code?
Choose the correct option.
a. 23
b. 13
c. 24
d. 14

Topic : GF_JAVA_JAN10 Sub Topic : Classes and Objects


Question 6 Topic: JAVA, Sub-topic : Classes and Objects

An inner class has free access to private member data of the outer classes.

State TRUE/FALSE
a. FALSE
b. TRUE

Topic : GF_OOAD&UML Sub Topic : UML


Question 7 Topic:OOAD&UML, Sub-Topic:OOAD&UML

An interaction between an actor and a system is denoted by a line marked by a _______


tag.

Fill in the blank with an appropriate option.


a. <<uses>>
b. <<extends>>
c. <<embed>>
d. <<linked>>

Topic : GF_OOAD&UML Sub Topic : UML


Question 8 Topic:OOAD&UML, Sub-Topic:OOAD&UML

Identify the option in which the objects can exist independent of each other.

Choose the most appropriate option.


a. Aggregation
b. Association
c. Composition
d. All of the above

Topic : GF_OOAD&UML Sub Topic : UML


Question 9 Topic:OOAD&UML, Sub-Topic:OOAD&UML

"UML is independent of particular programming languages and development processes."


State TRUE or FALSE.
a. TRUE
b. FALSE

Topic : GF_JAVA_JAN10 Sub Topic : Inheritance


Question 10 Topic:Java,Sub-Topic:Fundamentals

Consider the following code:

class Numerator {
void compute() {
show(); }
static void show() {
System.out.println("Numerator");
}}
public class Fraction extends Numerator {
void compute() {
System.out.println("Denominator"); }
public static void main(String args []) { }
{
Numerator num=new Fraction();
num.compute();
}}

What will be the output of the above code?


Choose most appropriate option.
a. Numerator
b. Denominator
c. Numerator Denominator
d. Program will compile successfully but nothing will printed at console.
e. None of the above
Topic : GF_JAVA_JAN10 Sub Topic : Inheritance
Question 11 Topic:Java,Sub-Topic:Inheritance

Consider the following code:

class Award{
void show() {
System.out.println("Award");
}
}
class Accept extends Award{
public static void main(String[] args) {
Accept exer = new Accept();
exer.acceptAward();
System.out.print(" the Award");
}
void show() {
System.out.print("Accept ");
}public void acceptAward() {
Accept accept = new Accept();
Award award = new Award();
award = accept;
award.show();
}
}

What will be the output of above code?


Choose most appropriate option.
a. Award
b. the Award
c. Accept
d. Accept the Award
e. the Award Accept
Topic : GF_JAVA_JAN10 Sub Topic : Java Fundamentals
Question 12 Topic: Java, Sub-Topic: Fundamentals

Consider the following code:

public class PractDemo {


public static void main(String argv[]) {
System.out.println(argv[2]);
}
}

What will be the output of the above code, if this code is run with the following command
line?
java PractDemo High Performance

Choose most appropriate option.


a. PractDemo
b. High
c. Performance
d. High Performance
e. Exception raised: "java.lang.ArrayIndexOutOfBoundsException: 2"
Topic : GF_JAVA_JAN10 Sub Topic : Java Fundamentals
Question 13 Topic:Java,Sub-Topic:Fundamentals:

Consider the below statements:

1. null is java reserved word.


2. null can be assigned to all primitive data types.
3. If the package statement present, then it must be the first non-comment statement in a
Java source file.
4. We can place same class in different packages by defining different package statements
in the same java source file.
5. The argument following the new keyword must be a class name followed by a series of
constructor arguments in required parenthesis.

Choose the VALID statements.


a. 1,3
b. 1,3,5
c. 1,2,4
d. 2,4
e. 1,3,4
f. 1,2,3,4,5
Topic : GF_JAVA_JAN10 Sub Topic : Polymorphism
Question 14 2 Topic: JAVA, Sub-Topic: Polymorphism

Consider the following code:

class Demo1 {
public void meth1() {
System.out.print("Demo1.Method2"); } }
public class Demo2 extends Demo1 {
public void method1() {
System.out.println("Demo2.Method1"); }
public static void main(String[] args) {
((Demo1)new Demo2()).meth1(); } }

What will be the output of the above code?


Choose most appropriate option
a. Demo1.Method2
b. Demo2.Method1
c. Demo1.Method2 Demo2.Method1
Topic : GF_JAVA_JAN10 Sub Topic : Java Fundamentals
Question 15 2 Topic: JAVA, Sub-Topic: Java Fundamentals

Consider the below code:


public class Color{
public void foo(boolean boolA, boolean boolB){
if(boolA){
System.out.println("Black");
}else if(boolA && boolB){
System.out.println("Red");
}else{
if(!boolB){
System.out.println("Green");
}else{
System.out.println("Red");
}
}
}public static void main(String argsp[]){
new Color().foo(false,false);
}
}
What will be the output of above code?
Choose appropriate option.
a. Black
b. Blue
c. Green
d. Red
e. Both Black and Green gets printed
Topic : GF_JAVA_JAN10 Sub Topic : Inheritance
Question 16 Topic:Java,Sub-Topic:Fundamentals

Which of the following code, when compiled, gives error?


Choose most appropriate option.
a. class Book { Book(String title) {} } class ScienceBook extends Book{ }
b. class Book { } class ScienceBook extends Book{ void ScienceBook(String title){} }
c. class Book {} class ScienceBook extends Book{}
d. class Book{} class ScienceBook extends Book { ScienceBook(){} }

Topic : GF_JAVA_JAN10 Sub Topic : Java Fundamentals


Question 17 3. Topic:Java,Sub-Topic:Fundamentals
Select the statements which are true about the boolean values.

Choose three appropriate options.


a. A boolean variable may only take on the values true or false
b. A boolean can be converted to or from any numeric type.
c. Expressions containing boolean operands can contain only boolean operands.
d. The Boolean class is a wrapper class for the boolean primitive type.

Topic : GF_JAVA_JAN10 Sub Topic : Polymorphism


Question 18 3. Topic: Java, Sub-Topic: Fundamentals

Methods declared as _________ cannot be overridden.

Fill in the blank with an appropriate option.


a. private, static or final
b. public,static or abstract
c. public or final
d. final

Topic : GF_JAVA_JAN10 Sub Topic : Polymorphism


Question 19 4. Topic: Java, Sub-Topic:Inheritence

Consider the following code:

class Calculator {
void add(int a) {
System.out.println("Integer method "); }
void add(float a) {
System.out.println("Float method "); }
void add(double a) {
System.out.println("Double method "); }
public static void main(String args[]) {
Calculator c=new Calculator();
c.add(12.23); } }

What is the output of the above code ?


Choose appropriate option.
a. Double method
b. Float method
c. Integer method
d. None of the above
Topic : GF_JAVA_JAN10 Sub Topic : Inheritance
Question 20 4. Topic: Java, Sub-Topic:Inheritence

Consider the following code:

class Acc {
static int num1=99;
protected static int num2=-101;
}
class Acc_Fundamental extends Acc {
public static void main (String[] args) {
num2--; num1--;
System.out.print(num1 + " ");
System.out.println(num2);
}
}

What will be the output of the above code?


Choose appropriate option.
a. 98 102
b. 98 -102
c. 98 -101
d. 98 -100

Topic : GF_Oracle_Jan10 Sub Topic : Aggregate Functions


Question 21 2. Topic:Oracle,Sub-Topic:SQL

Which of the below statements are VALID for aggregate functions?

Choose three appropriate options.


a. MIN() function returns the smallest value that occurs in the specified column
b. Column need not be numeric data type for the MIN() function
c. MIN() does not work on character datatype
d. MIN() function cannot be used on the DATE column

Topic : GF_Oracle_Jan10 Sub Topic : DDL


Question 22 2. Topic:Oracle,Sub-Topic:SQL

Identify the valid datatypes that can be used while creating table structure from the below
given options.

Choose four appropriate options.


a. varchar2
b. date
c. long raw
d. nvarchar2
e. boolean
Topic : GF_Oracle_Jan10 Sub Topic : DML
Question 23 2. Topic:Oracle,Sub-Topic:SQL

Sumit wants to disable the not NULL constraint in the PROJECTS_VALUE column of
PROJECTS table.

Choose most appropriate option that can be used.


a. ALTER TABLE PROJECTS MODIFY PROJECTS_VALUE NULL;
b. ALTER TABLE PROJECTS MODIFY PROJECTS_VALUE NOT NULL;
c. ALTER TABLE PROJECTS ADD PROJECTS_VALUE NOT NULL;
d. ALTER TABLE PROJECTS MODIFY PROJECTS_VALUE IS NULL;

Topic : GF_Oracle_Jan10 Sub Topic : DML


Question 24 2. Topic:Oracle,Sub-Topic:SQL

Consider the query:

SELECT DECODE(&age,null,NVL('','Not Applicable'),'Given') FROM DUAL;

Choose the most appropriate option when age is supplied as null.


a. "Not Applicable" is displayed
b. "Given" is displayed
c. Query fails

Topic : GF_Oracle_Jan10 Sub Topic : Introduction to RDBMS


Question 25 2. Topic:Oracle:Sub-Topic:SQL

Database design changes can be made dynamically without the users being aware of it.

Identify the above E.F.Codd's rule.


a. Logical Data Independence
b. Physical Data Independence
c. Conceptual Data Independence
d. None of the above

Topic : GF_Oracle_Jan10 Sub Topic : Sub-Query


Question 26 2. Topic:Oracle,Sub-Topic:SQL

Consider the following query:

SELECT * FROM emp WHERE projectid IN( SELECT projectid FROM project WHERE
projectdesc='EXAM MANAGEMENT' ORDER BY projectid);

What will happen when above query is executed?

Choose most appropriate option.


a. The appropriate data is returned from both EMP and PROJECT tables.
b. Data is returned from EMP but not from PROJECT
c. There is an error in the query.
d. Data is returned from PROJECT but not from EMP table.

Topic : GF_HTML-JSc_JAN10 Sub Topic : HTML


Question 27 2. Topic:Middleware,Sub-Topic:HTML

Identify the attributes of the input tag.

Choose three appropriate options.


a. type
b. name
c. value
d. div
e. br
Topic : GF_HTML-JSc_JAN10 Sub Topic : HTML
Question 28 2. Topic:HTML,Sub-Topic:HTML

Identify the tag, which contains "action" as one of its attributes.

Choose most appropriate option.


a. form tag
b. table tag
c. input tag
d. head tag
Topic : GF_HTML-JSc_JAN10 Sub Topic : HTML
Question 29 2. Topic:HTML,Sub-Topic:HTML

Which of the following statement about HTML is not true ?

Choose the most appropriate option.


a. HTML is encoding language for creating web pages that can be displayed by any
browser.
b. It is written using plain text editors or HTML editor.
c. HTML is more concerned about the content of the web page than the visual interface
d. It can have extension .htm or .html

Topic : GF_HTML-JSc_JAN10 Sub Topic : JavaScript


Question 30 2. Topic:JavaScript, Sub-Topic:JavaScript

Which of the following Popup boxes are supported by Javascript?

Choose three appropriate options.


a. Alert
b. Confirm
c. Prompt
d. MsgBox
e. Process
Topic : GF_HTML-JSc_JAN10 Sub Topic : JavaScript
Question 31 2. Topic:JavaScript, Sub-Topic:JavaScript

In order to print "Welcome" on the web page with the help of JavaScript, which of the
following option can be used?

Choose most appropriate option.


a. out.println
b. document.write
c. out.write
d. None of the above

Topic : GF_Oracle_Jan10 Sub Topic : Views


Question 32 2. Topic:Oracle,Sub-Topic:SQL
Consider the below query:

CREATE OR REPLACE VIEW myview AS SELECT ename,sal,job,deptno FROM emp


WHERE deptno IN (SELECT distinct deptno FROM dept ORDER BY sal) GROUP BY
job,deptno;

The above query is not valid.

Which of the following options are valid in order to solve the query?

Choose two appropriate options.


a. ORDER BY should come after GROUP BY
b. GROUP BY should contain all columns mentioned along with SELECT
c. Views cannot be created with Sub-query.Hence it has to be replaced
d. Use a Join instead of a sub-query

Topic : GF_OOAD&UML Sub Topic : UML


Question 33 4. Topic:Java,Sub-Topic:UML

Use Case Diagram displays relationships and interactions between _______ and the ______
they act upon.

Fill in the blank with an appropriate option.


a. actors,systems
b. objects,actors
c. systems,objects
d. objects,instances

Topic : GF_Oracle_Jan10 Sub Topic : E-R Diagrams


Question 34 N: Which of the following option is VALID with respect ERD?

Choose most appropriate option.


a. An entity in the E-R Diagram is represented by eclipse.
b. It is not helpful in developing the logical database design of the system.
c. It is a way of textual representing the logical relationships of entities.
d. It describes basic objects called entities.

Topic : GF_OOAD&UML Sub Topic : UML


Question 35 4. Topic:Java,Sub-Topic:UML

Which of the following statements are TRUE with respect to Sequence Diagram ?
Choose most appropriate option.
a. Messages are indicated as solid horizontal arrows attached to the timeline of the
source object to the target object
b. Messages are indicated as solid vertical boxes that run along horizontally towards the
source object or target object
c. Messages are indicated as dotted lines that are attached from the timeline of the
source object to the target object

Topic : GF_Oracle_Jan10 Sub Topic : DML


Question 36 Topic:Oracle,Sub-Topic:SQL

Gyan needs to change the definition of an existing emp table, the column EMPNAME is to
be changed so that it can hold characters up to 2000 characters.
Assume that currently column holds 1000 characters.

Which of the following statement can be used for this purpose?

Choose most appropriate option.


a. ALTER TABLE emp MODIFY EMPNAME TO CHAR2(2000);
b. ALTER TABLE emp ALTER EMPNAME CHAR2(2000);
c. ALTER TABLE emp CHANGE EMPNAME VARCHAR2(2000);
d. ALTER TABLE emp MODIFY EMPNAME VARCHAR2(2000);

Topic : GF_Oracle_Jan10 Sub Topic : Aggregate Functions


Question 37 Topic:Oracle,Sub-Topic:SQL

The CUSTOMERS table has these columns:

CUSTOMER_ID NUMBER (4) NOT NULL PRIMARY KEY, CUSTOMER_NAME


VARCHAR2 (100) NOT NULL, and STREET_ADDRESS VARCHAR2 (150)

Which of the following statement(s) will find the number of customers?

Choose two appropriate options.


a. SELECT TOTAL (*) FROM customers;
b. SELECT COUNT (*) FROM customers;
c. SELECT TOTAL (customer_id) FROM customers;
d. SELECT COUNT(customer_id) FROM customers;

Topic : GF_Oracle_Jan10 Sub Topic : DML


Question 38 Topic:Oracle,Sub-Topic:SQL

Consider the following query:


SELECT Qty FROM Sales WHERE Rate IN(300,800);

Raman wants to rewrite the above query without using IN operator, which of the following
option can repalce IN operator in order to get same output?

Choose most appropriate option.


a. AND
b. OR
c. LIKE
d. >=
e. BETWEEN..AND
f. <=
Topic : GF_Oracle_Jan10 Sub Topic : DML
Question 39 Topic:Oracle,Sub-Topic:SQL

Assume that you want to enter multiple rows into EXAM table.

Which is the appropriate option used to execute the same query repeatedly entering
different values for variables at runtime?

Choose most appropriate option.


Note: Ignore amp;
a. INSERT INTO EXAM (Stud_Roll,Test_No,Marks) VALUES(101,1,50);
b. INSERT INTO EXAM (Stud_Roll,Test_No,Marks) VALUES(v1,v2,v3);
c. INSERT INTO EXAM (Stud_Roll,Test_No,Marks) VALUES(&a,&b,&c);
d. INSERT INTO EXAM (Stud_Roll,Test_No,Marks) (SELECT
Stud_Roll,Test_No,Marks FROM EXAM);

Topic : GF_Oracle_Jan10 Sub Topic : Join


Question 40 4. Topic:SQL,Sub-Topic:Joins

You are setting up a join operation between tables EMP and DEPT. EMP table contains
details of employees who are assigned to departments and also there are some employees
who are not assigned to any departments yet.

The departments details are held in DEPT table. Identify the query that lists the names of all
the employees along with their department names?

Choose two appropriate options.


a. SELECT e.empno,d.dname FROM emp e LEFT JOIN dept d ON e.deptno=d.deptno;
b. SELECT e.empno,d.dname FROM emp e,dept d WHERE e.deptno=d.deptno ;
c. SELECT e.empno,d.dname FROM emp e,dept d ;
d. SELECT e.empno,d.dname FROM dept d RIGHT JOIN emp e ON e.deptno
=d.deptno ;

Close

Copyright 2006 - 2010 Accenture. All Rights Reserved. Accenture


Confidential. For Internal Use Only. Version History

You might also like