Q1: What is the keyword that we would use in order to indicate to the compiler t
ID: 3544081 • Letter: Q
Question
Q1: What is the keyword that we would use in order to indicate to the compiler that we intend to use a pre defined class from a library package?
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Q2: Do we need to write an import statement in order to use the String class? Explain your answer.
Q3: Do we need to write an import statement in order to use the Math class? (0.1 points)? Explain your answer.
Q4: Write two actions that the system takes (during interpretation of the program) when we use the non default constructor of People class, as an example, to create a People object. For instance, consider the code
People person1= new People (
Explanation / Answer
1) import e.g. import java.util.*;
2) No, String class is in java.lang package which is provided by java as default package, hence no need to import
3) No, Math class is in java.lang package which is provided by java as default package, hence no need to import
4)
Action One : Create a referrence to Class People, (People person1; )
Action two : Instantiate by new Operator (person1=new People (
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.