1. What defines the structure of expressions in a programming language?
a) His reserved words
b) Its syntactic rules
c) Its semantic rules
2. What does the programming process consist of?
a) Writing, compiling, and verifying the source code of a program
b) Compilation of the source code of a program
c) Compilation and verification of the Bytecode of a program
3. An algorithm is:
a) An ordered set of operations that allows finding the solution of
a problem
b) An ordered and finite set of operations that allows for finding the
solution to a problem
c) A random and finite set of operations that allows finding the solution of
a problem
4. A compiled Java program is portable because:
a) Bytecode is executable by the main operating systems of the
market
b) The Java runtime environment includes a virtual machine that interprets
the Bytecode
c) The environment from execution interpret the code
Java, independent of the virtual machine
5. Java is:
a) A programming language exclusively
b) A programming language Java, a development platform, a
runtime environment and a set of libraries for program development
sophisticated
c) A system to run programs on different computing platforms.
6. The Java Runtime Environment
a) It is a set of libraries for Java application development.
b) It is an intermediary piece between Bytecode and the different systems
existing operations in the market. Includes the Java virtual machine
c) It is the Java virtual machine.
7. The classic software development process consists of the following phases:
a) Coding, design, testing, and validation
b) Specification, design, coding, testing, and maintenance
c) Design, testing, validation, and maintenance
8. During the Specification phase of an application, the following is defined:
a) The functionality, the technical characteristics of an application and its
terms of use
b) The functionality and technical characteristics of an application
c) The technical characteristics and the conditions of use of application
the
9. The Java compiler analyzes the source code and:
a) Check that all its elements are valid words in Java and its
semantics
b) Check that all its elements are valid words in Java
c) Check that all its elements are valid words in Java, verify
the syntactic structure of the program and its semantics
10. The readability of a Java program is important because:
a) It facilitates software maintenance and allows for error correction or
modify the functionality at a lower cost
b) Avoid compiler errors
c) It allows for error correction, although it does not facilitate the maintenance process.
of an application
11. Java is a language that distinguishes between uppercase and lowercase letters.
a) False
b) True
12. The name of a Java element must adhere to the rule:
a) It must start with a letter that can be followed by more letters.
b) It must start with a letter that can be followed by more letters or digits
c) It must start with a letter that may be followed by digits
13. In Java, variable and method names must start with a lowercase letter. If the
Name Is Compound, Each Word Must Start With Capital Letter.
a) False
b) True
14. In Java, class names must always start with an uppercase letter. If the
Name Is Compound, Each Word Must Start With Capital.
a) False
b) True
15. A data type indicates the values that a variable can hold and the range of
values that it admits.
a) False
b) True
16. Which of the following expressions is correct?
a) double radio = 2;
b) double radio = 2.0;
c) double radio = 2.0;
17. The + operator is overloaded because it allows adding numbers and concatenating.
strings.
a) False
b) True
18. Indique el valor de: x = -1 + 5 * 7–12 / 3
a) 28
b) 30
c) 6
19. Indique el valor de: x = (-1 + 5) * 7–(12 / 3)
a) 26
b) 30
c) 24
20. Indique el valor de: x = 3 > 2 && 6 < 10 || true
a) true
b) false
21. A class describes a type of objects with common characteristics.
a) False
b) True
22. An object is an abstract representation of a class.
a) False
b) True
23. The attributes of an object can only store primitive types of Java.
a) False
b) True
24. When is the constructor method of a class executed:
a) An alias is created and the object's attributes are initialized.
b) A memory space is assigned to the instantiated object and is initialized with the
attributes of the object
c) A memory space is allocated to the instantiated object, but it is not initialized.
the attributes of the object
25. The constructor method is executed every time an object of the class is instantiated.
a) False
b) True
26. The state of an object can change during the execution of a Java program.
a) False
b) True
27. Un objeto se compone de:
a) Attributes
b) Attributes and methods
c) Attributes and constructor methods
28. A method is a function that:
a) Determine the behavior of a class
b) Determines the behavior of a class and its objects
c) Determine the behavior of an object
29. The methodmain()It is invoked when a Java program is executed.
a) False
b) True
30. Method overloading is useful for:
a) That the same method operates with parameters of different types or that a
same method receives a different list of parameters
b) That the same method operates with parameters of different types.
c) That different methods operate with parameters of different types
31. What does the following source code do?
int x=0;
boolean flag = false;
while ((x<10) || !flag) {
[Link](x);
x++;
}
Show the numbers from 0 to 9
Show the numbers from 1 to 10
Show a 10
It gets stuck in an infinite loop
32. How can I use the number PI in Java?
PI
[Link]
[Link]
There is nothing, it must be declared 3.141592
33. What are the values of X and Y at the end of the program?
int x = 0;
do {
[Link](x);
x++;
} while (x<10);
int y= 0;
while (y < 10) {
[Link](y);
y++;
}
x=9 y=9
x=10 y=10
x=9 y=10
x=10 y=9
34. What is the result of the following program?
int i=1;
[Link] ( i == 1 );
true
false
undefined
i == 1
35. What is printed on the screen?
int x = 10;
int y = 3;
[Link](x%y);
3
2
1
0
36. It is necessary to use the break statement in a switch structure so that the program
compile.
Yes, it is strictly necessary
No, it's not necessary.
Yes, if there are conditions that cannot be met.
Yes, but only in switches that handle integers.
37. Is it mandatory to use the default statement in a switch structure?
Yes, always.
Yes if no value meets the condition.
Yes, but only for integer values.
No, it is not mandatory.
38. What is the result of the following program?
int k=3;
int m=2;
[Link] ((m <= 99) & (k < m));
true
false
24
0111011
39. What is the value displayed on the screen?
int x = 5;
int y = 5;
y /= ++x;
[Link](y);
6
5
1
0
40. What does the following program do?
String sPalabra = "palabra";
int inc = 0;
int des = [Link]() - 1;
boolean bError = false;
while ((inc<des) && (!bError)){
if ([Link](inc)==[Link](des)){
inc++;
des--;
} else {
bError = true;
}
}
Count the letters in a word
Calculate if there are repeated letters in a word
Calculate if a word is a palindrome
The program does not compile
41. What does the following line of code do?
z = x++ + y;
It is not correct, it does not compile.
Add the value of X+Y to Z and then increment X by one.
Increase the value of X by one and add it to Y to assign it to Z.
Add one to X and assign it to Z, then add Y to Z.
42. What does the following source code display on screen?
int x=1;
switch (x) {
case 1:
One
case 2:
Two
case 3:
[Link]("Tres");
default:
Another number
}
One
Two
Another number
One Two Three Another number
43. What does our mystery function do?
public static double mystery(double x, int y) {
return (x*y)/100;
}
Calculate the 10th part of X over Y
Calculate the 2 decimal places of the value of X.
Calculate the percentage Y over the value of X
None of the three is correct
44. What is the precision of a short data type?
8 bit
16 bit
32 bit
64 bit
45. What is the final value of y?
int x = 0;
int y = 0;
while (x<10) {
y += x;
x++;
}
[Link](y);
0
10
11
45
46. What is the result of the operation?
int x=1;
[Link](++x*4+1);
6
5
9
7
47. What type of structure does the following code represent?
while (counter < 20) {
[Link]("Line number " + counter);
counter++;
}
Sequential Structure
Repetitive Structure
Selective Structure
None of the three above.
48. What is the result of the following operation?
[Link](12&13);
true
false
12
13
49. What is the result of the following operation?
[Link](5>>1);
6
true
4
2
50. What type of structure does the following code represent?
int x, counter;
contador = 10;
x = counter + 1
The value is
Selective Structure
Sequential Structure
Repetitive Structure
None of the three above.
51. Is Java an object-oriented language?
Yes
No
It depends on the use
Depends on the Compiler
52. What is the value displayed on the screen?
int x=10;
int y=0;
while (y<x) {
x += y;
}
[Link](y);
0
1
10
None, enters an infinite loop
53. What type of structure does the following code represent?
if (counter < 34) {
The counter is less than 24
}
Sequential Structure
Repetitive Structure
Selective Structure
None of the three above.
54. What does the following line of code do?
x += 2;
Assign the value of 2 to the variable x
Add 2 to the value of the variable x
Subtract 2 units from the value of x
None of the three options is valid
55. What is the value of x?
double x = [Link](2, 2);
4
4
4.0
Any of the three is valid.
56. What is the result of the following program?
int i=1;
int j=2;
int k=3;
int m=2;
[Link] ((j >= i) || (k == m));
true
false
undefined
Gives a compilation error
57. What does the following source code do?
import [Link];
import [Link];
public class MyFirstApplet extends Applet {
public void paint(Graphics g){
Hello World
}
}
Print in console the text 'Hello World'
Generate an Applet with the text 'Hello World'
Create a window that contains the text 'Hello World'.
None of the previous answers are correct.
58. What is the result of the operation?
[Link](2+6>>2);
8
5
4
2
59. Which company developed Java?
Microsoft
Oracle
SUN Microsystems
Fujitsu
60. What is the result of the following program?
int k=3;
int m=2;
[Link](!(k > m));
3
true
2
False
61. In operator precedence, which one comes first?
*/%
+-
++expression
<<
62. What does the following source code print on the screen?
int x = 10;
int y = 3;
x %= y;
[Link](y);
4
3
2
1
63. What does the following line of code do?
total -= --counter;
It does not compile, it is wrong.
Decrement the counter to total and then subtract one from the counter.
Decrement one from the counter and then subtract it from total.
Decrement one from the counter and then assign it to total.
64. What would be displayed on the screen?
Hello World
Hello World
Hello World
["Hello","World"]
Hello World
65. What value is displayed on the screen?
int x = 0;
int y = 0;
while (x<5) {
y += x;
x++;
[Link](y);
10
5
0
The program does not compile
66. What is the precision of an int data type?
8 bit
16 bit
32 bit
64 bit
67. How can I raise a number to a power?
[Link]
Operator **
[Link]
Operator ^
68. What is displayed on the screen?
for (int x=0;x<10;x++)
[Link](x);
The numbers from 1 to 9
The numbers from 0 to 9
The numbers from 1 to 10
The program does not compile
69. What is the result of the following program?
int j=2;
[Link] ( j == 3 );
true
false
undefined
j == 3
70. Which one from the list is not a data type in Java?
byte
float
double
single
71. What is the value displayed on the screen?
int x = 5;
int y = 5;
y is multiplied by x, then x is incremented.
[Link](x);
25
30
6
35
72. What is the precision of a long data type?
8 bit
16 bit
32 bit
64 bit
73. What does the following code do?
counter += x;
Add the value of x to the counter
Assign x to the value of counter
Add one to the value of x and assign it to the counter.
None of the three above is correct.
74. What result does the following operation give?
[Link](4<<1);
5
8
true
3
75. Does source code One do the same as source code Two?
Code One
int x= 0;
do {
[Link](x);
x++;
} while (x<10);
/* Code Two */
int y = 0;
while (y<10){
[Link](y);
y++;
}
No, the first shows from 1 to 10 and the second from 0 to 9.
Yes, both show from 0 to 9
No, the first shows from 0 to 9 and the second from 1 to 10.
Yes, both show from 1 to 10
76. What value is displayed on the screen?
int counter;
int x = 3;
counter += x;
[Link](counter);
3
1
0
The program does not compile
77. How do I calculate the percentage of a number in Java?
Operator %
[Link]
[Link]
It must be calculated by hand.
78. What is the value displayed on the screen?
int x = 5;
int y = 5;
y multiplied by x incremented after
[Link](y);
25
30
6
35
79. A string is used to define variables or constants of type:
whole
decimals
character
all of the above
80. To display messages on screen, use:
[Link]
[Link]
[Link]
All are correct
81. The double is applied for data types:
whole
decimals
character
none of the above
82. The assignment of a variable is applied with the ==
yes
no
both are correct
none of the above
83. Is the if used when there are 2 possible answers?
yes
no
both are correct
none of the above
84. The class name must be different from the package.
yes
no
it doesn't matter
none of the above
85. The call of a library is made using the:
import
scanner
string
none of the above
86. What is the structure that allows initializing the program?
public class
void main
system. out
all of the above
87. The libraries are called within:
package
public class
void main
none of the above
88. How is what is written on the screen captured?
scanner
integer
printf
if
89. What does the following code print:
A message.
A calculation.
A figure.
A Diagram
90. The following program prints:
A menu.
A list of items.
A receipt.
A shopping list.
91. The following program prints:
This.key1 and This.key2.
Key1 and Key2.
setKey1 and setKey2.
DoubleKey.
92. It is a data set and a set of operations that are performed with that data.
What type of data is being discussed:
TDA.
Class.
Instance.
Object.
93. It is the action that an object performs when it sends a message or in response to a change.
of state.
Behavior.
Execution.
Diffusion.
Instantiate.
94. The following example is from:
Set.
UML.
Abstraction.
Data entry.
95. There are two types of constructors, these are:
Set and Get.
String and Double.
Public and Private.
Without arguments and with arguments.
96. Communication occurs in the same way between an object and the objects it contains,
when objects need to interact, they do so through:
Sending codes.
Sending messages.
Sending coordinates.
Sending information.
97. Because object-oriented programming relies on them, these three pillars
they are like a tower of bricks; remove the last brick and everything will come crashing down. Which
these three pillars are:
Abstraction, interface, and encapsulation.
Interface, inheritance, and abstraction.
Inheritance, polymorphism, and encapsulation.
Abstraction, interface, and polymorphism.
98. They are the external and visible characteristics of a class:
Attributes.
Class.
Methods.
Variables.
99. Predecessor program to Java?
Directx
OpenGL
C++
100. Is a class or a method abstract if declared with the reserved word?
new
abstract
public
private
101. What is a chain?
It is a class that cannot be instantiated
Sequence of characters delimited by double quotes
It is an abstract method
They are characters without double quotes
102. What is polymorphism based on?
In declaring methods in a class
When creating classes and methods in a program
Using the same method for different objects
When using a method for a single object
103. What do you understand by inheritance in Java?
Ocurre al crear varios métodos en una clase
It is the action of creating derived classes from a class b
It occurs when creating a method without a return.
It occurs when defining variables in a class
104. When creating a derived class from a base class, is it inherited?
Only the methods
Only the variables
Variables and methods
Does not inherit anything