Академический Документы
Профессиональный Документы
Культура Документы
Q5-What is a preprocessor?
Ans-Preprocessor is a directive to the compiler to perform certain things before the
actual compilation process begins.
Q8-What is variable.
Ans-A variable is the name storage.
Q10-Properties of Oops?
Ans-1.Polymorphism 2.Encapsulation 3.Inheritence 4.Abstraction.
Ans) ‘++a” is called prefixed increment and the increment will happen first on a
variable. ‘a++' is called postfix increment and the increment happens after the value
of a variable used for the operations.
Q21-What is an object?
Ans-An object is an instance of a class .
Q22-What is a constructor?
Ans-A constructor is methods which are used to create an Object of class. There are
two types of constructor Default & Parameterized constructor
Q23-What is inheritance?
Ans-Inheritance is property in which the property of a parent class(Superclass) is
passed on to child class(Subclass).
Q24-What is polymorphism?
Ans-Polymorphism is the ability of an object to take on multiple forms. Most
commonly polymorphism is used in OOP when a parent class reference is used to
refer to a child class object.
Q28-What is an Interface?
Ans-The interface is a reference type in Java, similar to the class but its collection of
abstract methods. A class can implement multiple interfaces.
SQL Questions:
1. Write a SQL query to fetch the count of employees working in project 'P1'.
Ans-SELECT COUNT(*) FROM EmployeeSalary WHERE Project = 'P1';
2.Write a SQL query to fetch employee names having salary greater than or equal to
5000 and less than or equal 10000.
Ans-SELECT FullName
FROM EmployeeDetails
WHERE EmpId IN
(SELECT EmpId FROM EmpolyeeSalary
WHERE Salary BETWEEN 5000 AND 10000);