Question

In: Computer Science

I expect the answer is F but I am a little confused. Do you mind explaining...

I expect the answer is F but I am a little confused. Do you mind explaining your reasoning?

T/F Calling a void method can be part of an expression.

I believe the following is T, am I right?

A variable declared within the body of a loop does not retain its value from one loop iteration to the next.

I believe the following is T, am I right?

Named method parameters are stored in a call frame on the stack.

I believe the following is T, am I right?

A block of statements may be used anywhere a single statement is expected.

I believe the following is F, am I right?

Getters that comply with the JavaBeans convention are always declared with a void return type.

I believe the following is F, am I right?

A statement can be used wherever an expression is expected.

I believe it is T, am I right?

Every object is associated with a specific class used to create that object.

Solutions

Expert Solution

  1. Calling a void method can be part of an expression. False
    Explanation: An expression is always used to calculate some value, so if an expression contain void method(), it means method do not return any value. That's why a void method can't be part of an expression.
  2. A variable declared within the body of a loop does not retain its value from one loop iteration to the next. False
    Explanation: It is false, Generaly a local variable change their value from one loop iteration to the next but it is not always true, suppose we have a string variable declared within loop is intitialized with "Welcome" and we use it to display this message on each loop iteration so it retain its value.
  3. Named method parameters are stored in a call frame on the stack. True
    Explanation: Each time a method calls another method, an entry is pushed onto the stack and this entry is called a stack frame or an activation record. A stack frame contains the return address that the called method needs in order to return to the calling method.
  4. A block of statements may be used anywhere a single statement is expected. True
    Explanation:
    A statement is a command executed by translator program (compiler etc.). It could be either single statement or compound statement. We can use a compound statement when a single statement is required.
  5. Getters that comply with the JavaBeans convention are always declared with a void return type. False
    Explanation:
    A getter method has no parameters but returns a value of the property's type. It is used to returns its value. Therefore, we never used a void as a return type for getter method.
  6. A statement can be used wherever an expression is expected. False.
    Explanation: We cannot write a statement where expects an expression. For example, an if statement cannot become the argument of a function.”
  7. Every object is associated with a specific class used to create that object. True
    Explanation:
    An object is created from a class. An instance is a specific object created from a particular class. Therfore, every object is associated with a specific class used to create that object.

Related Solutions

What do I do for this? I am confused in what to do. Choose a developmental...
What do I do for this? I am confused in what to do. Choose a developmental domain covered in Module 2 (motor, self-care, cognitive). Provide a rationale for why development in this area is important for overall child development. Provide three strategies you would recommend caregivers implement at home to advance their childrens' skills in the chosen developmental domain.I chose the Self-Care domain.
This is to be done in excel (which I can do), but I am confused about...
This is to be done in excel (which I can do), but I am confused about which tail test to use and why to accept or reject H0- and the summary. According to research, holiday shoppers spent an average of $370 over a holiday weekend in 2008. The accompanying data show the amount spent by a random sample of holiday shoppers during the same weekend in 2009. Retailers were concerned that the economic downturn was affected holiday sales. Does this...
I am a bit confused on this T/F question. Please provide an explanation. I said T....
I am a bit confused on this T/F question. Please provide an explanation. I said T. 1. The "this" keyword is meaningful only within instance methods. The options are Generics Interfaces Classes Fields Methods {{{{{{{{I chose interface}}}}}}}}}} 2. Abstract data types are expressed as which of these in Java;
I am getting confused on finding the ethical challanges to this question. I am understanding but...
I am getting confused on finding the ethical challanges to this question. I am understanding but second guessing my answers when it come to the elements and the Ethical Code Standards. 1. Identify an ethical challenge for each element (a-d) of Dr Lux advertising plan. Which General Principles and Ethical Code Standards best help understand why these elements may create ethical problems? Explain why. Case 5. Web-Based Advertising. Dr. Lux, an applied developmental psycholgoist, has created his own community consulation...
I am confused on the Gram-Schmidt Orthogonalization Process and how it works? The examples do not...
I am confused on the Gram-Schmidt Orthogonalization Process and how it works? The examples do not make sense to me. Thank You.
Please answer in detail. I am confused because the two equations are equal to each other....
Please answer in detail. I am confused because the two equations are equal to each other. How do I find the number of grills and attendees. My teacher wants exact numbers. Kyle hosted a massive networking cookout last weekend and wants to write it off as a business expense for his taxes. The problem is, the cookout was so big Kyle can't remember how many people attended or even how many grills he rented. What he does know is that...
Hello, I am studying and I am a bit confused about registers. There are segments registers,...
Hello, I am studying and I am a bit confused about registers. There are segments registers, data registers, pointer registers, index registers. But I do not really understand where these are found. Are they found in 8086 architecture? For instance if I ask what type of registers are found in 8086 architecture what will be the answer? All of these or only segment registers?
Hi I am working on my chemistry homework about acids and bases and I am confused...
Hi I am working on my chemistry homework about acids and bases and I am confused on this question from a lab. We used grape juice and cranberry juice and we had to put HCl and NaOH in the test tube full of juice. 1. Referring back to procedure 1 of the experiment, which of the two juices is more useful as a general pH indicator and why? I think it is grape juice but I just don't know what...
Can you please give a step by step for this as well? I am very confused...
Can you please give a step by step for this as well? I am very confused on the topic. 1. A currently employed woman, working for $40,000 per year is considering opening her own business. She estimates that renting a space will cost her $30,000 per year; hiring a part-time employee will cost her $20,000 per year; purchasing equipment will cost $70,000; and other out-of-pocket expenses will come to $30,000. She estimates that her total revenues will be $170,000 per...
This is my lab and I am very confused regarding the calculations! It is supposes to...
This is my lab and I am very confused regarding the calculations! It is supposes to demonstrate Le Chatelier’s principle. After doing the following I need to calculate the molar absorbance for Co(H20)6 2+. The path length is 1cm and absorbance is .551. I got 5.51 L/mol *cm. I also need to calculate the CoCl4 2- molar absorbance which I do not understand. The absorbance is .570 and the path length is 1cm. I do not know how to find...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT