Questions from Starting Out With Java


Q: In procedural programming, what two parts of a program are typically

In procedural programming, what two parts of a program are typically separated?

See Answer

Q: What are an object’s attributes?

What are an object’s attributes?

See Answer

Q: What are an object’s methods?

What are an object’s methods?

See Answer

Q: What is encapsulation?

What is encapsulation?

See Answer

Q: Write a statement, after the following code, that creates an

Write a statement, after the following code, that creates an HBox container, and adds the label1, label2, and label3 controls to it: Label label1 = new Label("One"); Label label2 = new Label("Two"); L...

See Answer

Q: What is data hiding?

What is data hiding?

See Answer

Q: Assume that oneChar is a char variable. Write a statement that

Assume that oneChar is a char variable. Write a statement that stores the first character in the string referenced by the city variable in oneChar.

See Answer

Q: Assume that upperCity is a String reference variable. Write a statement

Assume that upperCity is a String reference variable. Write a statement that stores the uppercase equivalent of the string referenced by the city variable in upperCity.

See Answer

Q: Assume that lowerCity is a String reference variable. Write a statement

Assume that lowerCity is a String reference variable. Write a statement that stores the lowercase equivalent of the string referenced by the city variable in lowerCity.

See Answer

Q: How do you write a single line comment? How do you

How do you write a single line comment? How do you write a multi-line comment? How do you write a documentation comment?

See Answer