Advertisement
kernel_memory_dump

Untitled

May 15th, 2015
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.17 KB | None | 0 0
  1. public class GlavnaKlasa {
  2.  
  3. public static void main (String[] args){
  4. Televizor tv;
  5.  
  6. tv = new Televizor();
  7. try {
  8. tv.pojacajZvuk(99999);
  9.  
  10.  
  11. }catch (NijeUkljucenException  izuzetak) {
  12.    izuzetak.printStackTrace();
  13. }
  14. ///////////////////////////////////
  15.  
  16.  
  17. public class Televizor {
  18.  
  19. int trenutniKanal;
  20. final int MAX_KANAL = 255;
  21. final int jacinaZvuka;
  22.  
  23.  
  24.  
  25. public int pojacajZvuk(int zaKoliko) throws NijeUkljucenException {
  26.    if ( !ukljucen) {
  27.         NijeUkljucenException  izuzetak = new NijeUkljucenException();
  28.         throw  izuzetak;
  29.   }  
  30.  
  31. if( (zaKoliko+jacinaZvula) < 100 || zaKoliko > 0){
  32.          
  33.  
  34. }
  35.  
  36.        jacinaZvuka += zaKoliko;
  37.        return jacinaZvuka;
  38.  
  39.  
  40. }
  41.  
  42.  
  43. public int promeniNaSledeci() {
  44.     if(ukljucen) {
  45.  
  46.  }
  47.        trenutniKanal++;
  48.    return trenutniKanal;
  49.  
  50.  
  51. }
  52.  
  53.  
  54.  
  55. }
  56.  
  57.  
  58. /////////////////////////////////////////////////////////////
  59.  
  60. public class NijeUkljucenException extends Exception {
  61.        
  62.         public NijeUkljucenException() {
  63.                 super();
  64.     }
  65.  
  66.         public NijeUkljucenException(String poruka) {
  67.                    super(poruka);
  68.     }
  69.  
  70.  
  71.  
  72.  
  73. }
  74.  
  75.  
  76. //////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement