Cuestionario

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 41

Conteste las siguientes preguntas

Upon which of the following programming


languages is the Java programming language
loosely based?

A. C++
B. C
C. Machine language
D. CORBA
Which item is part of the J2SE JDK?

A. The Java runtime environment
B. The Java Virtual Machine specification
C. A C++ compiler
D. A linker

With which of the following is the testing
stage of the PLC usually synonymous?

A. Executing your program
B. Selling your program
C. Maintaining your program
D. Compiling your program

Why is the Java programming language said
to be platform-independent?

A. Runs on several platforms without
modification
B. Does not allow pointers to be used to
manipulate memory
C. Allows developers to create applications
once that execute on several platforms
D. Is multithreaded

Which of the following Java technology
product groups is designed for developing
applications for consumer devices?

A. The J2SE JDK
B. The J2EE JDK
C. The J2ME JDK
Which of the following terms represents two
different properties of an object?

A. Methods and operations
B. The problem domain
C. Attributes and operations
D. Variables and data

Which of the following statements is true?

A. A class is an instance of an object.
B. An object is a blueprint for a class.
C. An object is an instance of a class.
D. An object and a class are exactly the same.
Seleccione la definicin de datos correcta,
Seleccione una respuesta

a. float z=12.5;
b. byte w=455;
c. char y=0x0061;
d. short a=123876;

Seleccione la declaracin incorrecta de un
float, Seleccione una respuesta

a. float a=3.1416f;
b. float a=3.1416F;
c. float z=2.3e-5F;
d. float w=6/(float)4;
e. float alfa= 234.5;
f. float gama=(float)345.6;

Se puede ocupar un sufijo d o D para
especificar explcitamente que se trata de un
double. Ejemplo:
double z=124.67d;
double z=124.67D;

Respuesta:
a) Verdadero
b) Falso

Los mtodos y los constructores pueden ser
sobrecargados y sobrescritos.

Respuesta:
a) Verdadero
b) Falso

El propsito del garbage collector es buscar y
eliminar objetos que ya no puedan ser
utilizados.

Respuesta:
a) Verdadero
b) Falso

Este es un ejemplo de sobrecarga
public int suma (int x,int y){
......
}
public void suma (int x,int y){
....
}
Respuesta:
a) Verdadero
b) Falso


Which is a valid starting delimiter for a
comment?

a) /*
b) */
c) \
d) /
True o False: Every open curly bracket in a
java technology program must have a
corresponding closing curly brace.

a) True
b) False
Evalu el siguiente cdigo e indique cual es
el valor final de e.

a) int a=28;
b) int b=7;
c) int e=b<<3>a? a:b;
d) System.out.print(r);

Analice el siguiente cdigo y diga cual se
imprime
a) int p=10, q=0;
b) boolean r;
c) r=p!=0 && q!=0;
d) System.out.print(r);

Respuesta Se imprime false

Which of the following statements best
describes the main method?

a) The main method is the starting point for all java
technology
b) The main method is requiered in all java classes
c) The main method has a return type of int
d) The main method is a special method that the java Virtual
Machine recognizes as the starting point for every Java
Technology program run from a command line
True or False: in the Java programming
language, the variable names intgrade and
intGrade are the same.

a) True
b) False

Which of the following operations correctly
illustrate operator precedence in the
following calculation?

A) (1+2) *(5-8) + (6/7*4))
B) 1+ (2*5) 8 + ((6/7)*4)
C) (1+2) * (5 (( 8+6)/ (7*4)))
D) 1+ (2* (5-8)) + ((6/7) * 4)
Which of the following would be the correct
output, after execution, of the code shown?

A) a= 5 and b= 5
B) a= 5 and b= 6
C) a= 6 and b= 6
D) a= 6 and b= 5
Which answer best describes this varible
declaration?

A) this is the value assignment for an integral primitive
type.
B) The name of the variable is a java programming
language keyword
C) The variable is a constant
D) The variable is incorrectly named, according to the
naming guidelines.
Seleccione la declaracin incorrecta de los
mtodos sobrecargados:

a) Deben de cambiar la lista de argumentos.
b) Pueden cambiar el tipo de retorno.
c) Pueden cambiar el modificador de acceso.
d) Pueden declarar nuevas o ms amplias
excepciones.
e) Un mtodo puede ser sobrecargado en la misma
clase o en una subclase.

which of the followwing are attribute varible
declarations and initializations that adhere to
the variable declaration and initialization
syntax?
a) public int myInteger=10;
b) long myLong;
c) long = 10;
d) private int = 100;
e) private int myInteger=10;
Variables declared outside of a method or
that represent the attributes of an object are
referred to by which of the following?
a) Attribute variables
b) Instance variables
c) Common variables
d) Global variables
Which of the given options are the primitive
types?
a) int
b) Char
c) Integer
d) boolean
e) String
You want to show a composition relationship
where B is part-of A. Which of the given UML
diagrams shows the relationship correctly?

a) A
b) B
c) C
d) D

Which of the following statement is true
about the UML diagram given below?


a) This is a valid object diagram
b) This is a valid class diagram
c) This is an invalid UML diagram
d) This is a valid UML diagram, but not a class diagram
or an object diagram.

Which of the given code fragments will
compile without errors?

a) int i=true;
b) float b=0;
c) double d=-1;
d) float s=1.2;
Which of the given code fragments will not
compile?

a) byte a=128;
b) byte b=100; b*=1;
c) byte b=1; b=b+1;
d) int i=128; byte a=(byte)i;
Which of the given code fragments correctly
create an array?

a) int [ ] x = {1,2,3};
b) int x[ ] = (0,1,2);
c) int array[ ] = new int [3];
d) int x [ ] = new int (3);
Which of the following options is the result of
compiling and running the code given below?




a) prints numbers from 0 to 9
b) prints numbers from 0 to 10
c) prints numbers from 1 to 9
d) prints numbers from 1 to 10
Which of the following options is the result of
compiling and running the code given below?


a) Does not compile
b) Prints 0
c) Prints 5
d) Prints 4
Which of the given statements are the
benefist of encapsulation?
Select any 2 options:
a) Better speed, since the atributes can be directly
accessed without going through the operation.
b) better safety, since the atributes can be modified
only through the methods
c) Better flexibility, since the atributes can be
modified by any external code
d) better reusability, since the atributes cannot be
directly modified by external code
Which of the given options determines the
number of references required in the other
class participating in an association
relationship? Select any option:
A) Role
B) RelationCount
C) multiplicity
D) Navigability
A concrete class is one which, select any 2
options:

A) can extend an abstract class
B) can be instantiated
C) Can have abstract methods
D) Can have only private attribute and public
methods
A class that implements an interface is
connected to that interface using, select any
1 option:
A) A solid line with a triangle at the interface end.
B) A dashed line with a triangle at the class end
C) a dashed line with a triangle at the interface end
D) A solid line with a triangle at the class end

Which of the following statements is true
about the UML diagram given below?, select
any 1 option
A) The diagram shows C and B extending V
B) The diagram shows C and B implementing V
C) the diagram uses invalid UML notation
D) The diagram shows a composition relation

Regarding the diagram given below, which of
the attributes of SC are accessible from C?
Select any 1 option:

A) myVar
B) setVar
C) getVar
D) none of these
Regarding the UML diagram below, which of
the following statements are true?, select any
2 options.
A) the UML diagram is valid
B) The UML diagram is invalid
C) this UML diagram would be valid if the 2
triangles are fused into a single triangle.
D) This UML diagram would be valid if Shape is
represented as an interface.

You might also like