Cuestiones
ayuda
option
Mi Daypo

TEST BORRADO, QUIZÁS LE INTERESEEntornos

COMENTARIOS ESTADÍSTICAS RÉCORDS
REALIZAR TEST
Título del test:
Entornos

Descripción:
Tema 2 y 3

Autor:
a
(Otros tests del mismo autor)

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