Java programming questions and answers 100% verified.
Java programming questions and answers 100% verified. Primitive data types - correct , short, int, long, float, double, char, boolean 64-bit data types - correct e and long 32-bit data types - correct and float 16-bit data types - correct and char boolean - correct or false Cast operators - correct to manually convert a value; example: x = (int)number; instance variables - correct answers.Any method in the class definition can access these variables parameter variables - correct answers.Only the method where the parameter appears can access these variables. local variables - correct answers.Only the method where the parameter appears can access these variables the negation operator is: - correct This keyword is used to declare a method constant - correct Scanner class method to read a string as input - correct Line Scanner class method to read a double as input - correct Double When Java converts a lower-ranked value to a higher-ranked type, it is called: - correct ing conversion a variable must be declared before it is used - correct > < and == are - correct ional operators &&, ||, and ! are - correct al operators an empty statement that does nothing is: - correct statement blocks must be enclosed in - correct s {} the keyword to create an object: - correct the section of a switch statement branched to, if none of the case expressions match - correct lt an if statement that appears inside another if statement - correct d if statement a Boolean variable that signals when a condition exists in the program - correct How many operands does the conditional operator take - correct The scope of a variable is limited to the block in which it is defined - correct in the expression number++, the ++ operator is in what mode? - correct ix What is each repetition of a loop known as - correct tion the variable that controls the number of iterations performed by a loop - correct control variable the while loop is: - correct st the do-while loop is: - correct est the for loop is - correct st type of loop has no way of ending until the program is interrupted - correct ite this type of loop always executes at least once - correct -while This expression is executed by the for-loop only once, regardless of the number iterations - correct alization expression variable that keeps a running total - correct ulator What class do you use to open a file for writing - correct answers.PrintWriter Class used to open a file for reading - correct answers.File and Scanner Class that allows you to use print, and println methods to write data to a file. - correct answers.PrintWriter What type of method does not return a value - correct This appears at the beginning of a method definition - correct r value that is passed into a method when it is called is - correct ent a variable that receives a value that is passed into a method is - correct eter javadoc tag used to document a parameter variable - correct answers.@param This statement causes a method to end and sends a value back to the statement that called the method. - correct n the javadoc tag used to document a method's return value - correct answers.@return an object is an - correct nce method that gets a value from a class's field, but does not change it. - correct sor method that stores a value in a field or in some other way changes the value of a field - correct or method that is automatically called when an instance of a class is created - correct ructor this is automatically provided for a class if you do not write one yourself - correct lt constructor
Written for
- Institution
- Java programming
- Module
- Java programming
Document information
- Uploaded on
- September 12, 2023
- Number of pages
- 4
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
java programming questions
Also available in package deal