Computer Science, asked by ummeabihasyed, 7 months ago

Define these*
1. new Keyword
2. Scanner class
3. Polymorphism
4. Inheritance
5. Comments in java
6. Type Casting​

Answers

Answered by kumaripinky787
0

Explanation:

1).a new keyword is used to initialize/create an object. See the following example − Employee employee = new Employee(); Here new keyword is used to create an object of class Employee. new Employee() invokes the constructor of the class Employee.

2).Scanner is a class in java. util package used for obtaining the input of the primitive types like int, double, etc. and strings. It is the easiest way to read input in a Java program, though not very efficient if you want an input method for scenarios where time is a constraint like in competitive programming.

3).Polyamorphism is the ability of a substance to exist in several different amorphous modifications. It is analogous to the polymorphism of crystalline materials. Many amorphous substances can exist with different amorphous characteristics (e.g. polymers).

4).In Java, it is possible to inherit attributes and methods from one class to another. We group the "inheritance concept" into two categories: subclass (child) - the class that inherits from another class. superclass (parent) - the class being inherited from.

5).Comments can be used to explain Java code, and to make it more readable. It can also be used to prevent execution when testing alternative code. Single-line comments start with two forward slashes ( // ). Any text between // and the end of the line is ignored by Java (will not be executed).

6).In Java, there are two types of casting:

Widening Casting (automatically) - converting a smaller type to a larger type size. byte -> short -> char -> int -> long -> float -> double.

Narrowing Casting (manually) - converting a larger type to a smaller size type. double -> float -> long -> int -> char -> short -> byte.

Mark me as brainliest

Answered by Anonymous
8

Answer:

1 ) New keyword - The Java new keyword is used to create an instance of the class. In other words, it instantiates a class by allocating memory for a new object and returning a reference to that memory. We can also use the new keyword to create the array object.

2 ) Scanner class - The java.util.Scanner class is a simple text scanner which can parse primitive types and strings using regular expressions.Following are the important points about Scanner − A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace.

3 ) polymorphism - In Java we have the concept of Inheritance, the features of Parent Class can be inherited/extended to the Child Class, using that concept we can understand, what is Method Overriding in Java? We have already seen the example of method overriding in this article: Inheritance in Java with Example. We discussed that methods with private data members cannot be overridden, we come to same example again and discuss the use of Super Keyword.

sorry Dear I only know 3 answer mark me as brain list and follow me.

thank you...

Similar questions