Question: Note: The language is basic java Section 2: In this section you will determine possible errors and correct them: (Please find the errors in each

Note: The language is basic java

Section 2: In this section you will determine possible errors and correct them: (Please find the errors in each of the 8 lines)

1) String name=bob;

2) int number=20/3.0;

3) double m=23;

4) char x=a;

5) if(num>10);

System.out.println(num is num);

6) if(x=10)

System.out.println(x is equal to x;

Else

System.out.println(x is not equal to 10);

7) int sum=0;

for(int i=0;i<10;i++)

sum=sum+i;

System.out.printf(Sum is %5.2f ,sum);

8) If you want to print the following line

BOB MARLEY

You can use the following printf statement

System.out.printf(%S %S%d ,BOB,MARLEY)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!