Document Details

Uploaded by Deleted User

Sunny Hills High School

Tags

java programming programming questions programming review computer science

Summary

This document is a set of review questions for a Java programming course, covering various concepts from the fall semester. Questions include syntax, operators, objects, and more. Practice problems are also present.

Full Transcript

# Fall Semester Final Review 1. State the rules for variable names. 2. What is a bit? 3. What is a byte? 4. Define syntax. 5. Is Java portable? 6. When you compile a Java program what happens? 7. Define parameter. 8. Define argument. 9. All java statements must end with ____. 10. List the primitive...

# Fall Semester Final Review 1. State the rules for variable names. 2. What is a bit? 3. What is a byte? 4. Define syntax. 5. Is Java portable? 6. When you compile a Java program what happens? 7. Define parameter. 8. Define argument. 9. All java statements must end with ____. 10. List the primitive data type. 11. What is an identifier? 12. What is camel case? 13. What is Pascal case? 14. What is the java API? 15. Name the logical operators. 16. Name the relational operators. 17. What does "iterate through a list" mean? 18. What is an algorithm? 19. What does that statement "Java is case sensitive" mean? 20. What does instantiating mean? 21. What symbol is used for single line comments? 22. What is the keyword used to create and initialize an object? 23. A conditional expression in an If/Else statement must evaluate to what type of value? 24. State the syntax for an if/else statement. 25. State the format of a while loop. 26. State the format of a for loop. 27. State the general form for instantiating an object. 28. State the general form of a method header. 29. Write a statement to declare a World variable named earth and assign a new World object to it. 30. Write a statement to declare a Turtle variable named tommy and place it on earth. 31. Send tommy a message to move forward 70. 32. Using the method header: public void drawSquare() identify - a) Visibility type - b) Return type - c) Variable 33. What does the keyword this mean in a program statement? 34. What is method overloading? 35. What is the output? - System.out.print( 3 + + 4 + 5); - System.out.print( 3 + 4 + "" + 5 + 6); 36. The file name of a class must: _____. 37. What is a String? 38. Create a String variable, school and store "Sunny Hills High School" in it. 39. What do the following String methods do: - a. length - b. indexOf - c. length - d. charAt - e. substring 40. What do the following math class methods do? - a. Sqrt - b. Pow - c. Round - d. Abs - e. Random 41. When is null used? 42. What do each of these symbols mean? - a. ++ - b. -- - c. += - d. -= - e. /= - f. *= - g. %= 43. What is casting and how is it done in code? 44. What is a mutator method? 45. What is an accessor method? 46. What is a toString method? ## Consider Consider the class and client code below. What will the output be? ```java public class Aplus { public double go( double a) { return a * 3; } public double fun( double b) { return go( b ) + b; } } //client code in another class Aplus x = new Aplus(); System.out.println( x.go(2) ); ``` 47. Consider the following loop, where n is some positive integer. ```java for (int i = 0; i < n; i += 2) { ///* perform some action */ } ``` In terms of n, write an expression that represents the number of times that `/* perform some action */` could be executed.

Use Quizgecko on...
Browser
Browser