Question:
java programming questions?
Steve Aggor
2013-02-15 05:08:52 UTC
can someone help me with these homework questions

1. The equal sign ( = ) in Java is a command for assignment.

a. True
b. False

2. In Java, everything on the right side of an equal sign ( = ) is evaluated, or completed, first before assigning the value to the variable on the left side of the equal sign.

a. True
b. False

3. Each variable in Java must must be declared and initialized.

a. True
b. False

4. Write the Java import statement necessary to gain access to the Scanner class.

5. In Java there is a BIG difference between the single equal sign ("=") and the double ("==").

a. True
b. False
Four answers:
?
2013-02-15 05:14:09 UTC
1. a)

2. a)

3. a)

5. a)
green meklar
2013-02-17 04:48:49 UTC
1. (a)



2. (a)



3. (b)



4.

import java.util.Scanner;

or alternatively:

import java.util.*;



5. (a)



For 3, I answered (b) because, as far as I know, you only need to initialize a variable if you actually use it somewhere. You are, however, free to declare variables and never initialize them if they are never used.
Dan
2013-02-15 13:48:26 UTC
1) a

2) a

3) b - it's good practice to initialise a variable, but you don't have to

4) import java.util.Scanner;

5) a
Devang
2013-02-15 16:04:11 UTC
1-a

2-a

3-b

4-import java.util.*;

5-a


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...