Please answer each and every one of them thoroughly and as specifically as possi
ID: 3842800 • Letter: P
Question
Please answer each and every one of them thoroughly and as specifically as possible. Answer according to number as well.
Thanks!
Explanation / Answer
1. Scanner input= new Scanner(System.in);
int a = input.nextInt();
Here Scanner is the class. it comes from java.util package. Scanner object is used to get the input from the console.
2. Constructor is used for automatic intialization of objects. All classes are having default costructor with empty parameters. we can overide the constructor. Object constructor is used to assign the value to the constructor object.
3. Iteration is nothing but looping or traversing the elements in the collection. for ex, ListIterator.
for ex,
LinkedList<> al = new LinkedList<>();
4. Objects are the instance of the classes. Let us assume the Employee class.
public class Employee {
private String name;
private String idNumber;
private String department;
}
we can create object for the Employee class like below.
Employee obj = new Employee();
the 'new' keyword creates the object for the employee class.
obj.name ="bags"; //Like this we can set the value for the instance variables of the classes.
5. Object Oriented Programming reduces the complexity of the program .
Classes, Objects, Inheritance, Polymorphism, Abstraction, Data Encapsulation and Data hiding are the main core of the object oriented programming.
6. In GUI programming should be user friendly. A user can easily get the details from the graphical design of the page. It will navigate the sequence of pages in easily. The fonts, styles and other related stuffs should be in user friendly manner.