{"@context":"http://schema.org","@type":"Question","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo","text":"Сколько раз напечатается строка Hello?\n\u003cpre\u003e\u003ccode class\u003d\u0027java\u0027\u003e\npublic class Inc {\n\tstatic int x \u003d 0;\n\tstatic boolean ok \u003d true;\n\tstatic boolean f() {\n\t\tx++; \n\t\treturn (ok \u003d !ok);\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tif (f()||f()|f()) {\n\t\t\tfor (int i\u003d0; i\u0026lt;x; i++)\n\t\t\t\tSystem.out.println(\"Hello\");\n\t\t}\n\t}\n}\n\u003c/code\u003e\u003c/pre\u003e","headline":"Сколько раз напечатается строка Hello?\n\u003cpre\u003e\u003ccode class\u003d\u0027java\u0027\u003e\npublic class Inc {\n\tstatic int x \u003d 0;\n\tstatic ","learningResourceType":["programming test","programming course","programming question"],"isPartOf":{"@type":"Course","@id":"https://codegalaxy.io/courses/java-ru","url":"https://codegalaxy.io/courses/java-ru","name":"Java Quiz","description":"Java - объектно-ориентированный кросс-платформенный язык программирования, предназначенный для удобства чтения и интероперабельности. Java обычно читается как легкая и простая версия языка Си++. Тем не менее, Java может использоваться как полная версия для создания приложений, которые могут работать на всех платформах, поддерживающих Java, без необходимости перекомпиляции. В 2020 году Java является самым популярным языком программирования, с которым работают более 9 миллионов разработчиков. \u003cbr\u003e\nЭтот обучающий курс полностью посвящен \u003cstrong\u003eJava языку\u003c/strong\u003e, где вы можете проверить свои знания и ответить на \u003cstrong\u003e вопросы интервью по Java\u003c/strong\u003e. Вы ответите на теоретические и практические вопросы, которые проверяют ваши навыки на понимание \u003cstrong\u003e Java-кода\u003c/strong\u003e и поиска ошибок.\n\u003cbr\u003e\nВы можете вернуться к этому java курсу когда захотите, так как он постоянно обновляется и добавляются новые вопросы и задачки!\n\nПереведено с помощью www.DeepL.com/Translator (бесплатная версия)","provider":{"@type":"Organization","@id":"https://codegalaxy.io","name":"CodeGalaxy","logo":{"@type":"ImageObject","url":"https://codegalaxy.io/app/assets/images/g_code.png","height":"513","width":"513"},"description":"Project aimed to provide new ways in learning programming languages and preparing for the interview."},"image":{"@type":"ImageObject","url":"https://codegalaxy.io/app/assets/images/fb/16x9/share-java-ru.png","height":"630","width":"1200"}},"image":{"@type":"ImageObject","url":"https://codegalaxy.io/app/assets/images/fb/16x9/share-java-ru.png","height":"630","width":"1200"},"answerCount":6,"potentialAction":[{"@type":"AssessAction","object":{"@type":"Question","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo"}},{"@type":"ChooseAction","actionOption":[{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20312","url":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20312","text":"0","dateCreated":"2020-02-06"},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20313","url":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20313","text":"1","dateCreated":"2020-02-06"},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20314","url":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20314","text":"2","dateCreated":"2020-02-06"},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20315","url":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20315","text":"3","dateCreated":"2020-02-06"},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20316","url":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20316","text":"4","dateCreated":"2020-02-06"}],"object":{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20315","url":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20315","text":"3","dateCreated":"2020-02-06"}}],"audience":{"@type":"EducationalAudience","audienceType":["developers","programmers"],"educationalRole":["Specialist","Student"],"alternateName":"Java Programmers","name":"Java Developers","sameAs":["https://en.wikipedia.org/wiki/Programmer","https://en.wikipedia.org/wiki/Software_developer","https://en.wikipedia.org/wiki/Software_engineer","https://en.wikipedia.org/wiki/Web_developer"]},"dateCreated":"2020-02-06","acceptedAnswer":[{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#js-expander-trigger","url":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#js-expander-trigger","text":"Операторы || и \u0026amp;\u0026amp;, могут игнорировать второй операнд, если результат может быть определен по первому, то есть если первый равен соответственно true для || или false для \u0026amp;\u0026amp;. Операторы | и \u0026amp; вычисляют оба операнда.","about":{"@type":"Question","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo"},"upvoteCount":1,"dateCreated":"2020-02-06"},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20315","url":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20315","text":"3","dateCreated":"2020-02-06","upvoteCount":1}],"suggestedAnswer":[{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20312","url":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20312","text":"0","dateCreated":"2020-02-06","upvoteCount":0},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20313","url":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20313","text":"1","dateCreated":"2020-02-06","upvoteCount":0},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20314","url":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20314","text":"2","dateCreated":"2020-02-06","upvoteCount":0},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20316","url":"https://codegalaxy.io/courses/java-ru/questions/ad9948207b4044df9596f4b24a564e29/skolko-raz-napechataetsya-stroka-hello-public-class-inc-static-int-x-0-static-bo#20316","text":"4","dateCreated":"2020-02-06","upvoteCount":0}]}