This free survey is powered by
0%
Questions marked with a * are required Exit Survey
 
 
* Have you ever used Java?
 
No
 
Yes
 
 
 
Take a look at the following code, are there any errors?
class HelloWorld
{
public static void main (String[] args)
// your code goes here
System.out.println("hello\nworld");
}
 
No, there is no error with the above code
 
Yes, the following is incorrect:
 
 
 
 
Take a look at the following code, are there any errors?
Class HelloWorld
{
public static void main (String[] args)
{
System.out.println("hello world");
}
}
 
No, there is no error with the above code
 
Yes, the following is incorrect:
 
 
 
 
Take a look at the following code, are there any errors?
if (relative)
if (my friend)
cout << “both”;
else
cout << “neither”;
 
No, there is no error with the above code
 
Yes, the following is incorrect:
 
 
 
 
Take a look at the following code, are there any errors?
char response;
cout << “Please enter (y)es or (n)o ->”;
cin >> response;
while ((response != ’y’) || (response != ’n’))
{
cout << “Please try again. Enter (y)es or (n)o ->”;
cin >> response;
}
 
No, there is no error with the above code
 
Yes, the following is incorrect:
 
 
 
 
Take a look at the following code, are there any errors?
if (num = 100)
cout << “num equals 100”;
else
cout << “num is not 100”;
 
No, there is no error with the above code
 
Yes, the following is incorrect:
 
 
 
 
Take a look at the following code, are there any errors?
nit count = low ;
while ( count <= high )
{
count++ ;
}
 
No, there is no error with the above code
 
Yes, the following is incorrect:
 
 
 
 
Take a look at the following code, are there any errors?
class CMconvertINCH
{
public static void main(String[] args)
{
final double CM_PER_INCH = 2.54;
double paperWidth = 8.5;
System.out.println("Paper width in cms: " + paperWidth*CM_PER_INCH);
}
}
 
No, there is no error with the above code
 
Yes, the following is incorrect:
 
 
 
 
Take a look at the following code, are there any errors?
class LinePrint
{
public static void main (String[] args)
{
String line1 = (" | 1 2 3 4 5 6 7 8 9");
String line2 = (" | 1 2 3 4 5 6 7 8 9");

String newLine = System.getProperty(line.separator);
System.out.println(line1 + newLine + line2);

}
 
No, there is no error with the above code
 
Yes, the following is incorrect:
 
 
 
 
Take a look at the following code and select an answer?
public class SquareRoot
{
public static void main(String[] args)
{
double sqrt = 8025.73D;

System.out.println("The square root of " +
sqrt + " is " + Math.sqrt(sqrt));

}
}
 
No, there is no error with the above code
 
Yes, the following is incorrect: