(BOOST YOUR GRADES FOR 2024 EXAMS)WGU C482 Software 1: Oracle Certified Associate Java SE 8, Questions and answers. Graded A+
WGU C482 Software 1: Oracle Certified Associate Java SE 8, Questions and answers. Graded A+ What is an object? - -An object is a runtime instance of a class in memory. What is a class? - -A class is a program code template used to produce objects. Classes are the building blocks of Java. What are the members of the class? - -The members of a class consist of methods and fields. What are methods? - -Methods (also known as functions or procedures in other programming languages) are sets of code that are named. Those named sets of code can be called by invoking the name. Methods operate on the state of the program. What are fields? - -Fields are also known as variables and they are used to hold the state of the program. What is the format for writing a simple Java class? - -public class ClassName {} What does the public keyword mean? - -The public keyword means that the code in question can be used by another class. You can have public classes and public methods. What is a String? - -A String is a value that you can but text into. What is a parameter? - -A parameter is information that needs to be supplied to the calling method. For example: public void setName(String newName) has the parameter newName, setName is the name of the method, and void is the return type because this method doesn't return anything when called. What is a method signature? - -A method signature is the full declaration of a method. For example: public int numberOfVisitors(int month) is a method signature for the method numberOfVisitors. It has a return type of int and it takes one parameter, month. What is a comment? - -A comment is a line of non-executable code that is used to make code easier to read or to provide valuable information to the programmer. How do you write a single line comment? - -// comment here How do you write a multiple line comment? - -/* multiple * line comment here */ How do you write a javadoc comment? - -/** * javadoc multiple line comment * @author Jen and Scott */ What is a javadoc comment used for? - -A Javadoc comment has a specific structure that the Javadoc tool knows how to read. This structure allows the Javadoc tool to read and generate API documentation for the code. What is API? - -API (or application programming interface) is a set of clearly defined methods of communication between software components. Where does a Java program begin execution? - -A Java program begins execution at the main method. What is the main method? - -The main method is a gateway between the startup of a Java process which is managed by the Java Virtual Machine (JVM) and a programmer's code. How do you write a basic main method? - -You write a basic main method by writing the following line of code: public static void main(String[] args){ // main method goes here! } What does the keyword public declare? - -The keyword public is what's called an access modifier. It defines the levels of exposure to potential callers of the method. Naturally public means it can be called anywhere in the program. What does the keyword static mean? - -The keyword static binds a method to its class so it can be called just by the class name. What is a return type? - -A return type tells what a method returns after execution. A return type of int for example would indicate that you should expect an integer to be returned. The return type void indicates that there will be nothing returned by this method. What does String[] args indicate in the main method? - -The String[] args statement is a parameter of the main method. It can be written as String[] args, String args[], and String... args. These are all equivalent statements to Java, and it basically means you can read in an array of arguments of type string. What does the following mean? .ArrayIndexOutOfBoundsException: 1 at Z(Z) - -It means that at line 4 of the Zoo class main argument you have attempted to access an index of an array that doesn't exist. What is Java compiled into? - -Java is compiled into Java bytecode. This allows Java to be platform independent. During the compilation phase Java compiles the .java file into what? - -During compilation the .java file is compiled into a .class file that contains the program converted into Java Bytecode. What are packages? - -Packages are logical groupings of classes
Written for
- Institution
- University Of The People
- Course
- WGU - C482
Document information
- Uploaded on
- October 31, 2023
- Number of pages
- 81
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
wgu c482 software 1 oracle certified associate j