Questões de Concurso Público DATAPREV 2009 para Analista de Tecnologia da Informação - Desenvolvimento de Sistemas
Foram encontradas 60 questões
I. JAVA permite a declaração de campos de instância e estáticos.
II. JAVA permite apenas que sejam declarados campos de tipos básicos (double, float, byte, short, int, long, boolean e char).
III. JAVA não permite a declaração demétodos estáticos.
Sobre as afirmativas acima, pode-se dizer que:
01 class Prova{
02 public int a;
03
04 Prova(int _a){
05 a = _a;
06 }
07 public void acrescenta(int n){
08 a += n;
09 }
10 public void acrescenta(){
11 a++;
12 }
13 }
14 class SubProva extends Prova{
15 private int b;
16 SubProva(int umb, int uma){
17 super(uma);
18 b = umb;
19 }
20 public void acrescenta(int n){
21 b=b+n+2;
22 }
23 public static void main (String args[ ]) {
24 SubProva s = new SubProva(2,5);
25 Prova p = new Prova(2);
26 s.acrescenta(3);
27 p.acrescenta();
28 System.out.println(s.b+s.a);
29 System.out.println(p.a);
30 s.acrescenta();
31 System.out.println(" "+s.b+p.a+s.a) ;
32 }
33 }
01 class Prova{
02 public int a;
03
04 Prova(int _a){
05 a = _a;
06 }
07 public void acrescenta(int n){
08 a += n;
09 }
10 public void acrescenta(){
11 a++;
12 }
13 }
14 class SubProva extends Prova{
15 private int b;
16 SubProva(int umb, int uma){
17 super(uma);
18 b = umb;
19 }
20 public void acrescenta(int n){
21 b=b+n+2;
22 }
23 public static void main (String args[ ]) {
24 SubProva s = new SubProva(2,5);
25 Prova p = new Prova(2);
26 s.acrescenta(3);
27 p.acrescenta();
28 System.out.println(s.b+s.a);
29 System.out.println(p.a);
30 s.acrescenta();
31 System.out.println(" "+s.b+p.a+s.a) ;
32 }
33 }
01 class Prova{
02 public int a;
03
04 Prova(int _a){
05 a = _a;
06 }
07 public void acrescenta(int n){
08 a += n;
09 }
10 public void acrescenta(){
11 a++;
12 }
13 }
14 class SubProva extends Prova{
15 private int b;
16 SubProva(int umb, int uma){
17 super(uma);
18 b = umb;
19 }
20 public void acrescenta(int n){
21 b=b+n+2;
22 }
23 public static void main (String args[ ]) {
24 SubProva s = new SubProva(2,5);
25 Prova p = new Prova(2);
26 s.acrescenta(3);
27 p.acrescenta();
28 System.out.println(s.b+s.a);
29 System.out.println(p.a);
30 s.acrescenta();
31 System.out.println(" "+s.b+p.a+s.a) ;
32 }
33 }
01 class Prova{
02 public int a;
03
04 Prova(int _a){
05 a = _a;
06 }
07 public void acrescenta(int n){
08 a += n;
09 }
10 public void acrescenta(){
11 a++;
12 }
13 }
14 class SubProva extends Prova{
15 private int b;
16 SubProva(int umb, int uma){
17 super(uma);
18 b = umb;
19 }
20 public void acrescenta(int n){
21 b=b+n+2;
22 }
23 public static void main (String args[ ]) {
24 SubProva s = new SubProva(2,5);
25 Prova p = new Prova(2);
26 s.acrescenta(3);
27 p.acrescenta();
28 System.out.println(s.b+s.a);
29 System.out.println(p.a);
30 s.acrescenta();
31 System.out.println(" "+s.b+p.a+s.a) ;
32 }
33 }
.
.
.
x=3;
x--;
if(x < 3)
x--;
else
x++;
x+=2;
.
.
.
.
.
.
x=1;
for(i=0;i < 5; i++)
x+= i;
for(i=4;i > 1; i--)
x -= i;
.
.
.
01 class Circulo
02 {
03 private double raio;
04 public Circulo(double r)
05 {
06 raio = r;
07 }
08 public void setRaio(double r)
09 {
10 raio = r;
11 }
12 public double getRaio( )
13 {
14 return raio;
15 }
16 }
17 public classTeste
18 {
19 private static final Circulo roda = new Circulo(5.0);
20 public static void main (String args[ ])
21 {
22 System.out.println(“Raio = “ + roda.getRaio( ));
23 roda.setRaio(7.0);
24 System.out.println(“Novo raio = ”+ roda.getRaio( ));
25 }
26 }
01 class Circulo
02 {
03 private double raio;
04 public Circulo(double r)
05 {
06 raio = r;
07 }
08 public void setRaio(double r)
09 {
10 raio = r;
11 }
12 public double getRaio( )
13 {
14 return raio;
15 }
16 }
17 public classTeste
18 {
19 private static final Circulo roda = new Circulo(5.0);
20 public static void main (String args[ ])
21 {
22 System.out.println(“Raio = “ + roda.getRaio( ));
23 roda.setRaio(7.0);
24 System.out.println(“Novo raio = ”+ roda.getRaio( ));
25 }
26 }
By Brian X. Chen, August 28, 2008
Just as small, fast-moving mammals replaced lumbering
dinosaurs, pocketable gadgets are evolving to fill niches that
larger, deskbound computers can't reach. But as they shrink,
these gadgets are faced with problems mammals face, too,
such as efficiently dissipating heat.
The recent example of Apple's first-generation iPod nanos
causing fires in Japan raises the question of whether
increasingly innovative product designs are impinging on
safety. The nano incident illustrates how risk can increase as
devices decrease in size, says Roger Kay, an analyst at
EndpointTechnologies.
"As [gadgets] get smaller, the tradeoffs become more difficult,
the balance becomes more critical and there's less room for
error," Kay said. "I'm not surprised it's happening to the nano
because that's the small one. You're asking it to do a lot in a
very, very small package and that's pushing the envelope.”
There's no question that industrial designers' jobs have
become much more difficult as the industry demands ever
more powerful and smaller gadgets. With paper-thin
subnotebooks, ultrasmall MP3 players, and pinkie finger-
sized Bluetooth headsets becoming increasingly popular, it's
questionable where exactly designers draw the line between
innovation and safety.