7.4 (keyboard new) What\'s the purpose of keyboard new? Explain what happens whe
ID: 3758534 • Letter: 7
Question
7.4
(keyboard new) What's the purpose of keyboard new? Explain what happens when you use it.
7.5
(default constructors) A class declaresma constructor that takes two parameters. How would you create an instance of the class with no parameters?
7.6
(Instance variable) Explain the purpose of an instance variable.
7.7
(Using classes without importing them) Most classes need to be imported before they can be used in an app. Why is every app allowed to use classes System and String without first importing.
7.8
(Using a class without importing it) Explain how a program could use class scanner without importing it.
7.9
(set and get methods) Explain the disadventage of creating a class that has no set and get methods for an instance varibale.
Only 2 sentences for each
Explanation / Answer
7.4
The new keyword is used to initialize the object. We use it at the time of creating object.
7.5
declaresma()
{
}
7.6
Instance variables are used in class for manipulations in methods of class.
7.7
we can use System and String classes because by default java.lang.* package is by defult imported in every java program.
7.8
we can use fully qualified name of the class scanner as follows
java.util.Scanner s = new Scanner(System.in);
7.9
The main disdavantage is that we can not share values of private instance variable with main()
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.