Questions from Starting Out With Java


Q: Write a statement that instantiates the Line class, and uses the

Write a statement that instantiates the Line class, and uses the constructor to draw a line from (50, 25) to (150, 125).

See Answer

Q: 1. This type of method cannot access any non-static

1. This type of method cannot access any non-static member variables in its own class. 1. instance 2. void 3. static 4. non-static 2. When an object is passed as an argument to a method, this is actu...

See Answer

Q: 11. CRC stands for 1. Class, Return value

11. CRC stands for 1. Class, Return value, Composition 2. Class, Responsibilities, Collaborations 3. Class, Responsibilities, Composition 4. Compare, Return, Continue 12. True or False: A static memb...

See Answer

Q: 1. The isDigit, isLetter, and isLetterOrDigit methods are members

1. The isDigit, isLetter, and isLetterOrDigit methods are members of this class. 1. String 2. Char 3. Character 4. StringBuilder 2. This method converts a character to uppercase. 1. makeUpperCase 2....

See Answer

Q: 11. To delete a specific character in a StringBuilder object,

11. To delete a specific character in a StringBuilder object, use this method. 1. deleteCharAt 2. removeCharAt 3. removeChar 4. expunge 12. The character that separates tokens in a string is known as...

See Answer

Q: 21. True or False: The String class’s replace

21. True or False: The String class’s replace method can replace individual characters, but cannot replace substrings. 22. True or False: The StringBuilder class’s replace method can replace indi...

See Answer

Q: 1. In an inheritance relationship, this is the general class

1. In an inheritance relationship, this is the general class. 1. subclass 2. superclass 3. slave class 4. child class 2. In an inheritance relationship, this is the specialized class. 1. superclass 2...

See Answer

Q: 11. All classes directly or indirectly inherit from this class.

11. All classes directly or indirectly inherit from this class. 1. Object 2. Super 3. Root 4. Jaav 12. With this type of binding, the Java Virtual Machine determines at runtime which method to call,...

See Answer

Q: 21. You can use a lambda expression to instantiate an object

21. You can use a lambda expression to instantiate an object that ___. 1. that has no constructor. 2. extends any superclass. 3. implements a functional interface 4. does not implement an interface....

See Answer

Q: 31. True or False: When a class contains an abstract

31. True or False: When a class contains an abstract method, the class cannot be instantiated 32. True or False: A class may only implement one interface. 33. True or False: By default all members o...

See Answer