Falando sobre as Thread´s...
 
wait( ); => este cara irá parar o processo em questão até que seja enviado a liberação pelos próximos métodos;
notify( );  => este cara não é muito utilizado, pois vc não saberia quais os processos que vc deseja que seja ativado, ativado seria continuar o fluxo do processo parado pelo wait;
notifyAll( );  => este notifica todas as thread´s que podem continuar  seus fluxos, isso serve para que vc não necessite ficar testando para se algo que esta sendo feito por alguma thread esta pronto para o processo principal consumir...
 
Espero ter ajudado...
 
Quanto ao restante, primeiro vc tem que transformar para bit´s os valores em questão, que ele faz inversão de bit´s...
----- Original Message -----
Sent: Friday, January 17, 2003 12:07 PM
Subject: [java-list] Duvidas Gerais

Qual a diferenca entre wait(), notify(), notifyAll();
 
Alguem pode me explicar :
  • << Un-signed left shift
  • >> Signed right shift
  • >>> Un-signed right shift
public class TestShift {

       public static void main(String args[]) {
               int x = 1;
               x = x >> 31;
               int y = -1;
               y = y >> 31;
               System.out.println("The ouput of x is " + x );
               System.out.println("The ouput of y is " + y );

       }
}

 

public class TestShift {

      public static void main(String args[]) {
               int x = 1;
               x = x << 31;
               int y = -1;
               y = y << 31;
               System.out.println("The output of x is " + x );
               System.out.println("The output of y is " + y );

       }
}

 

public class TestShift {

       public static void main(String args[]) {
               int x = 1;
               x = x >>> 31;
               int y = -1;
               y = y >>> 31;
               System.out.println("The output of x is " + x );
               System.out.println("The output of y is " + y );

       }
}


Esta mensagem foi verificada pelo E-mail Protegido Terra.
Scan engine: VirusScan / Atualizado em 15/01/2003 / Versão: 1.3.13
Proteja o seu e-mail Terra: http://www.emailprotegido.terra.com.br/

Responder a