Answer:
The answer is "Option B".
Explanation:
In the given java program the main class test is defined. Inside the class, class b instance is created. In the next line, two-class are defined that is class A and class B and class B inherit class A.
In both classes we define a constructor and a method setI(). This method calculates the value that is passed in function and This class uses Overriding concept. In the given question other options are wrong that can be described as:
- In option A, Class B inherits class A and when class b object is created it is automatically called.
- In option C and option D, The constructor of class A is called but it displays 60, because of the constructor A call a function, that is setI() and passes value 20 parameter and because of using method overriding it display 60.
Answer:
The correct answer for the given question is "true"
Explanation:
A foreign key is a column in one table which value must match be the primary key in another table.The forign key provide a linking between the two table.
Suppose we have two table customer and order
customer table:
C_ID Name Age
1 rahul 30
2 sumit 23
order table:
C_ID o_id ordernum
1 123 13044
2 1234 13045
C_ID column is the PRIMARY KEY in the customer table
C_ID column is the FOREIGN KEY in the Order table
Because the value of C_ID column in order table is matched with PRIMARY KEY table i.e :customer table.So the answer is true .