Homework Help Question & Answers

JAVA QUESTION 1 The value returned by a value-returning method can be saved for further calculation...

JAVA

QUESTION 1

The value returned by a value-returning method can be saved for further calculation in the program.

True

False

QUESTION 2

To use a predefined method you must know the code in the body of the method.

True

False

QUESTION 3

A formal parameter is a variable declared in the method heading (ie. it's signature).

True

False

QUESTION 4

A local identifier is an identifier that is declared within a method or block and that is visible only within that method or block.

True

False

QUESTION 5

No two methods in the same class can have the same name.

True

False

QUESTION 6

Void methods have no return type.

True

False

QUESTION 7

The return statement must be the last line of the method.

True

False

QUESTION 8

When a program executes, the first statement to execute is always the first statement in the main method.

True

False

QUESTION 9

Given the method heading

public static String exampleMethod(int n, char ch)

what is the return type of the value returned?

int

char

String

Nothing will be returned

QUESTION 10

The method toString() is used to convert an object to a String object.

True

False

0 0
Next > < Previous
ReportAnswer #1
1)  True
2)  False
3)  True
4)  True
5)  False
6)  True
7)  False
8)  False
9)  String
10) True
Know the answer?
Add Answer of:
JAVA QUESTION 1 The value returned by a value-returning method can be saved for further calculation...
Your Answer: Your Name: What's your source?
Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • java

    public static char methodHeading(int n, double num)Based on the method heading in the accompanying figure, what is the return type of the value returned?a staticb charc intd numint larger(int x, int y)Given the method heading in the accompanying figure, which of the following does NOT demonstrate method overloading?a int larger(int x, int y, int z)b int larger(char x)c int max(int x, int y)d double larger(double x, double y)What is the default definition of the method toString?a There is no default...

  • I need java code for the following problem. Lab 7: Methods 1. Write a Java program called Numbers that calls the following methods and displays the returned value: Write a method called cubelt that a...

    I need java code for the following problem. Lab 7: Methods 1. Write a Java program called Numbers that calls the following methods and displays the returned value: Write a method called cubelt that accepts one integer parameter and returns the value raised to the third power as an integer. o Write a method called randominRange that accepts two integer parameters representing a range. The method returns a random integer in the specified range inclusive. 2. o Write a method...

  • Question is related to Class and objects in Java

    Design a class named MyInteger. The class contains:an int data field named 'value' that stores the int value represented by this object.a constructor that creates a MyInteger object for the specified int value.a get method that returns the int value.methods isEven(), isOdd(), and isPrime() that return true if the value is even, odd, or prime, respectively.static methods is Even(MyInteger), is Odd(MyInteger), and isPrime(MyInteger) that return true if thespecified value is even, odd, or prime, respectively.methods equals(int) and equals(MyInteger) that return...

  • Java Methods Help

    What I need help on is the findMatchingPerson method and the testPerson method. Also, I get an error at the line sum = sum + people[i]; in the averageAge methodthat I'm not sure how to fix. I know this is a lot of stuff, but I really need the help. i've been playing around with this for hours now and I just don'tunderstand. LifeSaver rating is guaranteed./*** Static Methods:* (1) averageAge: averages the ages of an array of Person objects.*...

  • Java: Species program

    Write a class encapsulating the concept of a Species. The Species class will have the following attributes:Instance variables:A string representing the name of the speciesAn int representing the population of the speciesA double representing the growth rate of the speciesClass variables (static variables):An integer value representing the number of existing speciesAn integer value representing the number of endangered speciesMethods:2 Constructorsaccessor methodsmutator methodstoString methodequals methodBoolean method called endangered. If the growth rate is negative the method returns trueotherwise it will return...

  • Need Help with Java Program!!! Please

    I don't know how to start this...the questionsare at the bottom. :-(Here is the first program:public class IntClass{private int x;public IntClass(){x = 0;}public IntClass(int num){x = num;}public void setNum(int num){x = num;}public int getNum(){return x;}public void addToNum(int num){x = x + num;}public void multiplyToNum(int num){x = x * num;}public int compareTo(int num){return (x - num);}public boolean equals(int num){if (x == num)return true;elsereturn false;}public String toString(){return (String.valueOf(x));}}Second Programpublic class CharClass{private char ch;public CharClass(){ch = ' ';}public CharClass(char c){ch = c;}public void...

  • Question 1 (5 points) Question 1 Unsaved What is displayed on the console when running the...

    Question 1 (5 points) Question 1 Unsaved What is displayed on the console when running the following program? public class Quiz2B { public static void main(String[] args) { try { System.out.println("Welcome to Java"); int i = 0; int y = 2 / i; System.out.println("Welcome to Java"); } catch (RuntimeException ex) { System.out.println("Welcome to Java"); } finally { System.out.println("End of the block"); } } } Question 1 options: The program displays Welcome to Java two times. The program displays Welcome to...

  • Create an abstract class “Appointment” that represents an event on a calendar. The “Appointment” class will...

    Create an abstract class “Appointment” that represents an event on a calendar. The “Appointment” class will have four instance variables: • An instance variable called “year” which will be of type int • An instance variable called “month” which will be of type int • An instance variable called “day” which will be of type int • An instance variable called “description” which will be of type String The “Appointment” class must also implement the following methods: • A getter...

  • JAVA QUESTION 16 Write and submit the java source for the following class specification: The name...

    JAVA QUESTION 16 Write and submit the java source for the following class specification: The name of the class is Question_16 Class Question_16 has 3 instance variables: name of type String, age of type int and height of type double. Class Question_16 has the following methods: print - outputs the data values stored in the instance variables with the appropriate label setName - method to set the name setAge - method to set the age setHeight - method to set...

  • java eclipse help

    Design a class named Fan to represent a fan. The class containsClass FanObjectextended by Fanpublic class Fanextends ObjectField Summarystatic int FASTstatic int MEDIUMstatic int SLOWConstructor SummaryFan()Constructor sets default values: radius = 5.0 color = "blue" speed = SLOW on = falseFan(double radius, String color, int speed, boolean on)Constructor with parameters for all data fieldsMethod SummaryString getColor()Get the color of the fandouble getRadius()Get the radius of the fanint getSpeed()Get the speed of the fanboolean isOn()Check whether fan is onvoid setColor(String color)Change...

Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
Share Your Knowledge

Post an Article
Post an Answer
Post a Question with Answer

Self-promotion: Authors have the chance of a link back to their own personal blogs or social media profile pages.