level: Level 1
Questions and Answers List
level questions: Level 1
Question | Answer |
---|---|
what is compiled | the process of translating the program to assembly |
what is interpretation | you see the code changes instantly |
what is execution | its compiled then interpreted line by line |
what is jvm | the virtual machine that translates java line by line |
3 errors in code | syntax, run time, logic |
what is pseudocode | a simplified version of code that you can write an algorithm in, used for planning |
What are the four different ways that the flow of control can progress through a program? Explain each one | Selection, repetition, method call, sequence |
What are the characteristics of a high-level language. | it looks like english and is easy to read |
How does an object class encapsulate data? | makes fields private |
What is the purpose of mutator methods? setters | they changer the value of the fields |
what is the purpose on constructors? getters | they define how to create an object |
what are the naming rules? | same name as class no return type |
what is an accessor method | getters, get a field value. getBleh |
how to write a mutator (setter) | public void setNumber(String number){ this.number = number; } public void setMaxOccupancy(int max){ if(max >= 25 && max <= 600) this.maxOccupancy = max; else }. this.maxOccupancy = 25; |