Cuestiones
ayuda
option
Mi Daypo

TEST BORRADO, QUIZÁS LE INTERESE Practice Test (Sessions 1-3)

COMENTARIOS ESTADÍSTICAS RÉCORDS
REALIZAR TEST
Título del test:
Practice Test (Sessions 1-3)

Descripción:
Entornos de desarrollo

Autor:
AVATAR

Fecha de Creación:
15/01/2024

Categoría:
Informática

Número preguntas: 59
Comparte el test:
Facebook
Twitter
Whatsapp
Comparte el test:
Facebook
Twitter
Whatsapp
Últimos Comentarios
No hay ningún comentario sobre este test.
Temario:
The program suffers a logic error if the _____. program compiles but an error is thrown after the program runs program has an empty main method program does not compile program compiles but a warning is shown after the program runs program compiles but it produces incorrect results.
Consider the following code segment: String varOne = "abc"; String varTwo = varOne; String varThree = new String("abc"); After this code is executed, which of the following statements will evaluate to true? 1) varOne.equals(varThree) 2) varOne == varTwo 3) varOne == varThree Number 1 and number 2 Only number 2 Only number 1 Only number 3 Number 1 and number 2 and number 3.
Which of the following statements assigns the letter 'A' to the 3rd row and 1st column of the two-dimensional array? varOne.setValue(2,0, 'A'); varOne[2][0] = 'A'; varOne[3][1] = 'A'; varOne[0][2] = 'A'; varOne[1][3] = 'A';.
Which one of these is a valid boolean declaration? boolean varOne = 'true'; boolean varOne = 'false'; boolean varOne = 1; boolean varOne = isTrue; boolean varOne = false;.
Which of the following statements show the correct use of an escape sequence? System.out.println("A backslash looks like this: /\"); System.out.println("A backslash looks like this: '\'."); System.out.println("A backslash looks like this: \."); System.out.println("Which is your \"favorite\" number?"); System.out.println("Which is your "favorite" number?");.
What is printed as a result of executing this code segment? String varOne = "Hello World!"; System.out.println(varOne.indexOf('W')); 6 4 7 5 An error will be thrown.
Which of the following will print "NaN"? System.out.println(Math.sqrt(-0)); None of the options System.out.println(Math.sqrt(-4)); System.out.println(Math.sqrt(1 / 0); System.out.println("Na" + 'n');.
Which of the following cannot be accomplished using Java? Creating mobile applications None of the options Creating games Creating a server Creating web applications.
Which of the following statements will display "Welcome to Java" on the console? System.print('Welcome to Java'); System.out.print('Welcome to Java'); system.out.print("Welcome to Java"); System.out.print("Welcome to Java"); System.out.println('Welcome to Java');.
Which one of the following choices accurately implements the Lower Camel Case naming convention for Java? testOne Testone testone TESTONE TestOne.
The extension name of a Java source file is .exe .java .obj .class .txt.
What is printed as a result of executing this code segment? int varOne = 0; for (int count = 0; count < 20; count++) { varOne++; if (varOne > 3) { break; } } System.out.println(varOne); 3 2 5 4 Nothing is printed because an error is thrown.
What is printed as a result of executing this code segment? String varOne = "Hello World!"; System.out.println(varOne.toLowerCase()); HELLO WORLD! Hello world! hello world! hello world An error will be thrown.
Which one of these choices below causes an error? int varOne = 1000, varTwo; int varOne, varTwo; int varOne = 10, varTwo = 10; int varOne; int varOne, int varTwo;.
Which of the following will print the String "Hello"? String varOne = " H e l l o "; System.out.println(varOne.trim()); String varOne = " Hello "; System.out.println(varOne.trim()); String varOne = " Hello Hello "; System.out.println(varOne.trim()); String varOne = "Hello World!"; System.out.println(varOne.trim()); String varOne = "H e l l o"; System.out.println(varOne.trim());.
Which statement below correctly declares and initializes the String value varOne? String varOne = "Hello World!"; String varOne = new String; string varOne = "Hello World!"; String varOne = "Hello World!" String varOne = new string;.
What is printed as a result of executing this code segment? int[][] varOne = {{1, 2, 3, 6}, {5, 8, 9, 10}, {7, 6, 7, 8}}; System.out.println(varOne[1].length); 6 1 4 3 An error would occur.
Which of these code segments will produce this output: 1 4 7 10 13 16 19 ? 1) int varOne = 1; while (varOne < 20) { if (varOne % 3 == 1) { System.out.print(varOne + " "); } varOne = varOne + 3; } 2) for (int varOne = 1; varOne < 20; varOne++) { if (varOne % 3 == 1) { System.out.print(varOne + " "); } } 3) for (int varOne = 1; varOne < 20; varOne = varOne + 3) { System.out.print(varOne + " "); } Only number 2 Only number 1 Numbers 1 and 2 Numbers 2 and 3 Numbers 1 and 2 and 3.
Which of the following lines is NOT a proper Java comment? ** comments ** //-- comments --// /*-- comments --*/ /* comments */ // comments.
Consider the following code segment: if (varOne > 0){ varOne = -varOne; } if (varOne < 0){ varOne = 0; } Which of the following is this code segment equivalent to? if (varOne < 0) { varOne = 0; } if (varOne < 0) { varOne = 0; } else { varOne = -1; } if (varOne > 0) { varOne = -varOne; } if (varOne > 0) { varOne = 0; } varOne = 0;.
Which of the following is the proper way to declare the main method? Public static void main(String[] args) public static void main(String[] args) public void main(String[] args) public static main(String[] args) def Main().
What is printed as a result of executing this code segment? int varOne = 0; int varTwo = 1; varOne = varTwo++; System.out.println("varOne: " + varOne + " varTwo: " + varTwo); varOne: 0 varTwo: 1 varOne: 0 varTwo: 0 varOne: 1 varTwo: 2 varOne: 1 varTwo: 1 varOne: 2 varTwo: 1.
What is printed as a result of executing this statement? System.out.println("Hello" + 1 + 2 + 3); Hello123 Hello6 Hello 1 2 3 Hello 123 Hello 6 .
Which of the following is a correct declaration of an imported class? import java.utilities.all; import java.ArrayList; `import java->util->ArrayList;` import java.util.*; import java.util.ALL;.
Which of the following statements is not correct? String values cannot be changed String is a class Every String is an object of class String String is not a primitive type Strings are mutable.
A program suffers a run-time error if the _____. program compiles but an error is thrown after the program runs program has an empty main method program compiles but it produces incorrect results program compiles but a warning is shown after the program runs program does not compile.
Which one of these is a valid long declaration? long varOne = 12901322/3; long varOne = 2411133L; long varOne = 24.22L; long varOne = 2.411.133; long varOne = 6.5;.
What is printed as a result of executing this code segment? double piValue = 3.14159; int radius = 5000; int circumference = (int)(2 * piValue * radius); System.out.println(circumference); 31416 31415.9 31415 30000 314159.
Which of the following is an example of an infinite loop? int varOne = 5; while (varOne > 0) { System.out.println("Java"); varOne++; } int varOne = 5; while (varOne < 15) { System.out.println("Java"); varOne++; } int varOne = 5; while (varOne != 3) { System.out.println("Java"); varOne--; } int varOne = 5; while (varOne < 0) { System.out.println("Java"); varOne--; } int varOne = 5; while (varOne > 0) { System.out.println("Java"); varOne--; }.
What is printed as a result of executing this code segment? String varOne = "abcdef"; for (int count = 0; count < varOne.length()-1; count++) { System.out.print(varOne.substring(count, count+2)); } abcbcdcdedef abbccddeef Nothing is printed because an IndexOutOfBoundsException is thrown aabbccddeeff abcdef.
Which one of the choices below best explain why indentation is important when programming? So the code will look good on display. Indentation makes you look like a better programmer. Java syntax requires indentation. So programmers can easily read the code and discover errors and issues effectively. Indentation allows space for comments.
What is printed as a result of executing this code segment? String varOne = "Hello World!"; System.out.println(varOne.charAt(8)); An error will be thrown o d l r.
Java compiler translates Java source code into _____. Java bytecode Assembly code Machine code Another high-level language code HTML code.
Given the fact that variable flightTime is larger that 60, which of the following can be used to replace /* missing code */ so that the flightTime can be displayed in hours and minutes? public class TestClass() { int flightTime = 130; int minutes = 0; int hours = 0; public static void main (String[] args) { /* missing code */ System.out.println("The flightTime is " + hours + " hours and " + minutes + " minutes long."); } } hours = hours + flightTime % 60; minutes = flightTime / 60; minutes = flightTime % 60; hours = hours + flightTime / 60; minutes = flightTime % 60; minutes = flightTime + flightTime % 60; hours = flightTime / 60;.
Which one of these is a valid float declaration? float varOne = PI; float varOne = 12/0; float var one = 12; float varOne = "12"; float varOne = 12;.
What is the value of varThree after this code is executed? int varOne = 3; int varTwo = 2; int varThree = 0; while (varOne <= 5){ varThree += varOne % varTwo; varOne++; varTwo++; } None of these answers are correct 1 111 3 2.
Which one of these is a valid character declaration? char varOne = "false"; char varOne = 'f'; char varOne = 1; char varOne = "true"; char varOne = 'java';.
What is the length of the String "Hello World!"? 11 12 13 14 15.
What is printed as a result of executing this code segment? double varOne; int varTwo = 56; int varThree = 25; varOne = varTwo / varThree; System.out.println(varOne); An error will occur 2.0 2.24 2.2 2.
Which one of these is a valid short declaration? short varOne = -4; short varOne = 6.28; short varOne = -12901322; short varOne = 12901322; short varOne = 24.22;.
Which of the following code segments produces the output "Java"? public class JavaClass{ Public static void main (String[] args){ System.out.println("Java"); } } public class JavaClass{ public static void main (String[] args){ System.out.printline("Java"); } } public class Java Class{ public static void main (String[] args){ System.out.println("Java"); } } public class JavaClass{ public static void main (String[] args){ System.out.println("Java"); } } public class JavaClass{ public Static void main (String[] args){ System.out.Println("Java"); } }.
Which one of the following is not a primitive data type? boolean int chars long short.
Consider the following code segment: String varOne = "abc"; String varTwo = varOne; String varThree = varTwo; After this code is executed, which of the following statements will evaluate to true? 1) varOne.equals(varThree) 2) varOne == varTwo 3) varOne == varThree Number 1 and number 2 and number 3 Only number 3 Number 2 and number 3 Only number 1 Only number 2.
Java was originally developed by _____. cisco System Oracle Apple Sun Microsystems Microsoft.
What is printed as a result of executing this code segment? String varOne = "Hello World!"; String varTwo = "Java"; System.out.println(varOne.compareTo(varTwo)); 20 2 false -2 An error will be thrown.
What is printed as a result of executing this code segment? int varOne = 0; int varTwo = 10; varOne = --varTwo; System.out.println("varOne: " + varOne + " varTwo: " + varTwo); varOne: 0 varTwo: 9 varOne: 10 varTwo: 10 varOne: 9 varTwo: 11 varOne: 10 varTwo: 9 varOne: 9 varTwo: 9.
Which of the following creates a String with the value null? String varOne = null; String varOne = new String(""); String varOne = ""; String varOne = new String("null"); String varOne = new String();.
Which of the following is a Java reserved word? While this external then Class.
Given three variables and their values below, which of the following boolean expressions evaluates to true? boolean varOne = false; int varTwo = 2; int varThree = 20; varThree + varTwo > varOne varThree > varTwo varOne !varTwo varTwo > varThree.
Which one of these is a valid byte declaration? byte varOne = '1'; byte varOne = 0; byte varOne = 129; byte varOne = twenty; byte varOne = 8 bits;.
______ is the software that interprets Java bytecode. Browser Java compiler Java debugger Java API Java virtual machine (JVM).
Which one of these is a valid integer declaration? int varOne = one; int var one = 1; int varOne = '1'; int varOne = "12"; int varOne = 323;.
Which one of these is a valid double declaration? double varOne = "123"; double varOne = -3.1415; double varOne = '1234'; double varOne = MathPI; double varOne = "123*1234";.
What will the value of varOne be after the following expression is evaluated? double varOne = 8+7*4-2.0/4 + (5-3*4-2); 69 39.5 2.5 -6.8 26.5.
Which of the statements below is correct? String varOne = parseInt(3); int varOne = parseInt("222" + "A"); int varOne = Int.parseInt("222"); int varOne = Integer.parseInt("222"); int varOne = parseInt("Hello");.
What is the value of varTwo after the following switch statement is executed? int varOne = 3; int varTwo = 4; switch (varOne+3) { case 6: varTwo = 0; case 7: varTwo = 1; default: varTwo += 1; } 1 2 3 4.
Which of the following is a valid identifier for a constant variable? public final char Constantvar = 'r'; public final boolean constantvar = true; public final int CONSTANTVAR = 30; double final CONSTANT_VAR = 2.3213; public final int constantVar = 10;.
What is the new value of varOne after the following code is executed? int varOne = 12; varOne += 5; varOne -= 10; varOne = 12; 9 7 12 An error would occur -5.
The extension name of a Java class file is .exe .obj .txt .java .class.
Denunciar test Consentimiento Condiciones de uso