1
1
53
52:51
Topic : GF_JAVA_JAN10 Sub Topic : Java Fundamentals
Question 1 Topic:Java,Sub-Topic:Java Fundamentals
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 ?
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.
An inner class has free access to private member data of the outer classes.
State TRUE/FALSE
a. FALSE
b. TRUE
Identify the option in which the objects can exist independent of each other.
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();
}}
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 the above code, if this code is run with the following command
line?
java PractDemo High Performance
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(); } }
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); } }
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);
}
}
Identify the valid datatypes that can be used while creating table structure from the below
given options.
Sumit wants to disable the not NULL constraint in the PROJECTS_VALUE column of
PROJECTS table.
Database design changes can be made dynamically without the users being aware of it.
SELECT * FROM emp WHERE projectid IN( SELECT projectid FROM project WHERE
projectdesc='EXAM MANAGEMENT' ORDER BY projectid);
In order to print "Welcome" on the web page with the help of JavaScript, which of the
following option can be used?
Which of the following options are valid in order to solve the query?
Use Case Diagram displays relationships and interactions between _______ and the ______
they act upon.
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
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.
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?
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?
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?
Close