Java Basico Flashcards

1
Q

Clase principal x

A
public class x{
}

x mismo nombre de archivo
x con Mayus, separada por _

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Metodo de clase principal

A

public static void main (String[] args){

}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Escribir comentario de linea x

A

// x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Escribir bloque de comentario x

A
/*
x
*/
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Convencion en nombramiento de variables

A

minusMayus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Convencion en nombramiento de constantes

A

TODOMAYUS
o
TODO_MAYUS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Convencion en nombramiento de clases

A

MayusMayus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Convencion en nombramiento de funciones

A

minusMayus
o
minus_Mayus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Declarar variable int x con valor n

A

int x = n;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Declarar variable byte x con valor n

A

byte x = n;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Declarar variable short x con valor n

A

short x = n;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Declarar variable long x con valor n

A

long x = n;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Declarar variable char x con valor y

A

char x = ‘y’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Declarar variable boolean x con valor y

A

boolean x = y;

y puede ser True o False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Declarar variable float x con valor n

A

float x = n;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Declarar variable double x con valor n

A

double x = n;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Imprimir valor de variable a

A

System.out.println(a);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Declarar variable enum a con valores n

A

public enum A {n1, n2, n3};

Declarar como clase

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Declarar variable string a con valor x

A

String a = “x”;

20
Q

Imprimir en span valor de variable a

A

System.out.print(a);

21
Q

Imprimir string x, int a

A

System.out.println(“x” + a);

22
Q

Valores literales booleanos

A

True

False

23
Q

Valor literal entero numeracion decimal n

24
Q

Valor literal entero numeracion octal n

25
Valor literal entero numeracion hexadecimal n
0xn
26
Valor literal long n
nl
27
Valor literal decimal n
n, nd, nf, d para double, f para float
28
Valor literal decimal n en notación científica m
n.nem, n.nemd, n.nemf d para double, f para float
29
Valor literal caracter x
'x', '\n', '\un' '\' para codigo octal, '\u' para codigo hexadecimal
30
Imprimir string x con barra diagonal
System.out.println("x\\");
31
Imprimir string x con comilla simple
System.out.println("x\'");
32
Imprimir string x con comilla doble
System.out.println("x\"");
33
Imprimir string x con salto de linea
System.out.println("x\r");
34
Imprimir string x con tabulacion
System.out.println("x\t");
35
Convertir decimal n a entero m, redondeando al mas cercano
int m = (int) Math.round(n);
36
Convertir decimal n a entero m, redondeando al mas alto
int m = (int) Math.ceil(n);
37
Convertir decimal n a entero m, redondeando al mas bajo
int m = (int) Math.floor(n);
38
Convertir char x a entero n
int n = (int) 'x'
39
Convertir entero n a char x
char x = (char) n
40
Escribir documentacion con descripcion x, con etiquetas @autor y, @return z, @see w
``` /** *x * *@autor y *@return z *@see w */ ```
41
Convertir string x a int n
int n = Integer.parseInt(x)
42
¿Que es el identificador de una variable?
El nombre que se le da a la variable
43
¿Cual puede ser el primer caracter de un identificador?
``` letra _ (subrayado) $ (dollar) ```
44
Diferencia entre variables miembro y variables locales
Variables miembro estan dentro de clase, fuera de funcion, las variables locales estan dentro de funcion
45
¿Que tipo de variables se inicializan automaticamente?
Variables miembro