Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- new Thread(new ThreadAB("bukvi")).start();
- new Thread(new ThreadAB("brojki")).start();
- }
- }
- class ThreadAB implements Runnable{
- String ej;
- public ThreadAB(String asd){
- ej = asd;
- }
- public void run() {
- if(ej.equals("bukvi")){
- for(char b = 'A';b<='Z';b++){
- System.out.println(b);
- }
- }
- else if(ej.equals("brojki")){
- for(int i=0;i<=26;i++){
- System.out.println(i);
- }
- }
- else{
- System.out.println("Nevalidna vrednost");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement