17)Describe the principles of OOPS.
A)Inheritance is the process by which one object acquires the properties of another object. Inheritance allows well-tested procedures to be reused and enables changes to make once and have effect in all relevant places
19)What is implicit casting?
A)Implicit casting is the process of simply assigning one entity to another without any transformation guidance to the compiler. This type of casting is not permitted in all kinds of transformations and may not work for all scenarios.
int i = 1000;
long j = i; //Implicit casting
Is sizeof a keyword in java?
The sizeof operator is not a keyword.
20)What is a native method?
A)A native method is a method that is implemented in a language other than Java.
21)In System.out.println(), what is System, out and println?
A)System is a predefined final class, out is a PrintStream object and println is a built-in overloaded method in the out object.
22)What are Encapsulation, Inheritance and Polymorphism
Or
Explain the Polymorphism principle. Explain the different forms of Polymorphism.
A)Polymorphism in simple terms means one name many forms. Polymorphism enables one entity to be used as a general category for different types of actions. The specific action is determined by the exact nature of the situation.
Polymorphism exists in three distinct forms in Java:
• Method overriding through inheritance
• Method overriding through the Java interface
A)There are three main principals of oops which are called Polymorphism, Inheritance and Encapsulation.
18)Explain the Inheritance principle.
A)Inheritance is the process by which one object acquires the properties of another object. Inheritance allows well-tested procedures to be reused and enables changes to make once and have effect in all relevant places
19)What is implicit casting?
A)Implicit casting is the process of simply assigning one entity to another without any transformation guidance to the compiler. This type of casting is not permitted in all kinds of transformations and may not work for all scenarios.
Example
int i = 1000;
long j = i; //Implicit casting
Is sizeof a keyword in java?
The sizeof operator is not a keyword.
20)What is a native method?
A)A native method is a method that is implemented in a language other than Java.
21)In System.out.println(), what is System, out and println?
A)System is a predefined final class, out is a PrintStream object and println is a built-in overloaded method in the out object.
22)What are Encapsulation, Inheritance and Polymorphism
Or
Explain the Polymorphism principle. Explain the different forms of Polymorphism.
A)Polymorphism in simple terms means one name many forms. Polymorphism enables one entity to be used as a general category for different types of actions. The specific action is determined by the exact nature of the situation.
Polymorphism exists in three distinct forms in Java:
• Method overloading
• Method overriding through inheritance
• Method overriding through the Java interface
No comments:
Post a Comment