package com.zindell.course.samples; public class SimpleThreadsDemo { public static String getMarketName() { // System.out.print("[within getMarketName " // +Thread.currentThread().getName()+"] "); return "Carmel"; } public static void main(String[] args) { Yarkan yarkan1 = new Yarkan("Moshe", "Banana"); Yarkan yarkan2 = new Yarkan("Haim", "Orange"); Thread t1 = new Thread(yarkan1); Thread t2 = new Thread(yarkan2); t1.start(); t2.start(); for (int i = 0; i < 10; i++) { System.out.println(Thread.currentThread().getName() + " " + SimpleThreadsDemo.getMarketName() + " "); try { Thread.sleep(100); } catch (Exception e) { e.printStackTrace(); } } } }