1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SSSSS [86.1K]
3 years ago
11

Analyze the following code. II: public class Test { public static void main(String[] args) { System.out.println("Welcome to Java

!"); } } Both I and II can compile and run and display Welcome to Java, but the code in II has a better style than I. Only the code in I can compile and run and display Welcome to Java. Only the code in II can compile and run and display Welcome to Java. Both I and II can compile and run and display Welcome to Java, but the code in I has a better style than II.
Computers and Technology
1 answer:
Grace [21]3 years ago
8 0

COMPLETE QUESTION

I. public class Test {

public static void main(String[] args){

System.out.println("Welcome to Java!");

}

}

II. public class Test { public static void main(String[] args) {System.out.println("Welcome to Java!");}}

Answer:

Both codes will compile and run and display Welcome to Java, but the code in II has a better style than I

Explanation:

When written codes, paying attention to proper coding styles and efficient memory management enables us to create programs that are highly efficient, coding styles refer to proper indentions and avoiding too lenghty lines of code (as is in code I), adding approprite comments etc.

You might be interested in
You want to decide whether you should drive your car to work or take the train. You know the one-way distance from your home to
tester [92]

<u>Explanation:</u>

Remember, an algorithm in simple words means a set of instructions or steps to be followed in other to solve a problem.

Note, to decide which commute is cheaper, it means the output of the algorithm should be the cheaper way to commute.

Using pseudocode do the following;

  • determine the inputs and outputs of the problem
  • arrange the identified problem into micro-tasks
  • describe each micro-tasks in the pseudocode
  • Test the pseudocode by solving the problem.

                       

3 0
3 years ago
Random stuff and pls don't report this thank you :D
skad [1K]

Answer:

hmmm....nice colors....what is it for?

Explanation:

6 0
3 years ago
Read 2 more answers
Why should you delete files from your computer
notka56 [123]

deleting files can free up space and prevent hackers from accessing your sensitive files

5 0
2 years ago
Read 2 more answers
Select the correct answer. What is the purpose of preserving historical data? A. legal compliance B. recruitment C. leave sancti
Gre4nikov [31]

Answer:The main goal of data preservation is to protect data from being lost or destroyed and to contribute to the reuse and progression of the data.

Explanation:

8 0
3 years ago
Assignment 4: Evens and Odds
Anika [276]

n = int(input("How many numbers do you need to check? "))

odd = 0

even = 0

i = 0

while i < n:

   num = int(input("Enter number: "))

   if num % 2 == 0:

       even += 1

       print(str(num)+" is an even number")

   else:

       odd += 1

       print(str(num)+" is an odd number")

   i += 1

print("You entered "+str(even)+" even number(s).")

print("You entered "+str(odd)+" odd number(s).")

I hope this helps!

5 0
3 years ago
Other questions:
  • In order to be compliant with the NIST publications, policies must include key security control requirements. One of these key r
    10·1 answer
  • Yahoo! allows users to create personalized my yahoo! pages. users can add or delete a variety of information from their personal
    8·2 answers
  • Name the component used in first generation of computer​
    10·1 answer
  • ROE: what does this represent (in plain terms)? In what range would this number typically be? What type of person/position would
    11·1 answer
  • There are 22 gloves in a drawer: 5 pairs of red gloves, 4 pairs of yellow, and 2 pairs of green. You select the gloves in the da
    12·1 answer
  • An application needs to calculate sales tax for purchases. You decide to simplify the code by putting the sales tax calculation
    9·1 answer
  • Which of the following is not a benefit of normalization?
    5·1 answer
  • What are the disadvantages of vector images when compared to bitmap images?
    14·1 answer
  • Input 3 positive integers from the terminal, determine if tlrey are valid sides of a triangle. If the sides do form a valid tria
    6·1 answer
  • A. A set of electronic program that makes of computer perform tasks
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!