This type of method does not return a value.
- a. null
- b. void
- c. empty
- d. anonymous
The method which does not return a value is called as “void()”.
Hence, the correct answer is option “B”.
Explanation of Solution
Methods:
A collection of statements which together perform an operation is called as methods.
- The main advantage of using method is reusability of code and it reduces the size of the program, because a method can be called for multiple times in the program.
void() method:
The method void executes a set of statements with no return value.
Explanation for incorrect options:
a. null:
The keyword null is used to declare the null data type
Hence, the option “A” is wrong.
c. Empty:
Empty is used to represent a string which has blank value in it.
Hence, the option “C” is wrong.
d. Anonymous:
There is no method called as “anonymous” in Java, but the nameless object in java is termed as anonymous object.
Hence, the option “D” is wrong.
Want to see more full solutions like this?
Chapter 5 Solutions
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Additional Engineering Textbook Solutions
Database Concepts (7th Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Starting out with Visual C# (4th Edition)
- Using Java, Write a method named isEven that accepts an int argument. The method should return true if the argument is even, or false otherwise. Also write a program to test your method.arrow_forwardWrite a method that returns a random number from alist of numbers passed in the argument. The method header is specified as follows:public static int getRandom(int... numbers)arrow_forwardIn Java, all arguments are transferred to a method via value call (call by value)? Choose one of the options:TrueFalsearrow_forward
- Create a C# statement that uses each of the following built-in methods you have used in previous chapters, then make an intelligent guess about the return type and parameter list for the method used in each statement you created. a. Console.WriteLine() b. String. Equals() c. String. Compare() d. Convert.Tolnt32 () e. Convert. Tochar() f. Array. Sort()arrow_forwardTrue or False? Arrays cannot be passed as parameters, but must be used only in the main method.arrow_forwardCreate a method that takes a value and indicate whether it is positive or negative by a return aBoolean value.Declared as: boolean isPositive (float a)arrow_forward
- java-Find the area of circle using method... Write an application that prompts the user for the radius of a circle and uses a method called circleArea to find tarea of the circle. method method should return the computed area to the caller method.arrow_forwardIn this program, create a method with the following signature: public static double getAverage(double d1, double d2, double d3, double d4, double d5) This method will accept five doubles and return the average. Also in program, create a method with the following signature: public static char determineGrade(double avg) This method will take an average, then return the corresponding letter grade. Write in java and use test case# as an example.arrow_forwardA(n) __________ is a piece of data that is passed into a method. a. variable b. argument c. string d. literalarrow_forward
- true or false ___ 19 Method double(x) that returns a value can be used in the Java expression 2*double(x) > 2*(6+4). ___ 20 Multiple return statements can be used in a method that returns a value.arrow_forwardTrue or FalseA value-returning method must contain a return statement.arrow_forwardWrite a method called upper that takes a lowercase character as a parameter and converts the character to uppercase and returns it without using String’s toUpperCase() method. public char upper(char lowerChar){ Question 26 options:arrow_forward
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,