{"@context":"http://schema.org","@type":"Question","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-","text":"Что выведет на консоль данный код:\n\u003cpre\u003e\u003ccode class\u003d\"java\"\u003e\npublic class Test {\n    public void checkCase(int i) {\n        switch (i\u0026amp;01) {\n            case 1:\n                System.out.println(\"Case 1\");\n            case 2:\n                System.out.println(\"Case 2\");\n            default:\n                System.out.println(\"Default\");\n            case 3:\n                System.out.println(\"Case 3\");\n        }\n    }\n    public static void main(String[] args) {\n        Test test \u003d new Test();\n        test.checkCase(-1);\n    }\n} \n\u003c/code\u003e\u003c/pre\u003e","headline":"Что выведет на консоль данный код:\n\u003cpre\u003e\u003ccode class\u003d\"java\"\u003e\npublic class Test {\n    public void checkCase(int ","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":7,"potentialAction":[{"@type":"AssessAction","object":{"@type":"Question","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-"}},{"@type":"ChooseAction","actionOption":[{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20512","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20512","text":"Ошибка компиляции из-за выражения i\u0026amp;01","dateCreated":"2020-02-06"},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20513","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20513","text":"Case 1","dateCreated":"2020-02-06"},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20514","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20514","text":"Default","dateCreated":"2020-02-06"},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20515","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20515","text":"Default\u003cbr\u003e\nCase 3","dateCreated":"2020-02-06"},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20516","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20516","text":"Case 1\u003cbr\u003e\nCase 2\u003cbr\u003e\nDefault\u003cbr\u003e\nCase 3","dateCreated":"2020-02-06"},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20517","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20517","text":"Ничего не будет выведено","dateCreated":"2020-02-06"}],"object":{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20516","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20516","text":"Case 1\u003cbr\u003e\nCase 2\u003cbr\u003e\nDefault\u003cbr\u003e\nCase 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/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#js-expander-trigger","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#js-expander-trigger","text":"Результат выражения -1 \u0026amp; 1 \u003d 1. Так как в case отсутствует break, то выведены будут все строки.","about":{"@type":"Question","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-"},"upvoteCount":1,"dateCreated":"2020-02-06"},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20516","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20516","text":"Case 1\u003cbr\u003e\nCase 2\u003cbr\u003e\nDefault\u003cbr\u003e\nCase 3","dateCreated":"2020-02-06","upvoteCount":1}],"suggestedAnswer":[{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20512","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20512","text":"Ошибка компиляции из-за выражения i\u0026amp;01","dateCreated":"2020-02-06","upvoteCount":0},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20513","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20513","text":"Case 1","dateCreated":"2020-02-06","upvoteCount":0},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20514","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20514","text":"Default","dateCreated":"2020-02-06","upvoteCount":0},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20515","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20515","text":"Default\u003cbr\u003e\nCase 3","dateCreated":"2020-02-06","upvoteCount":0},{"@type":"Answer","@id":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20517","url":"https://codegalaxy.io/courses/java-ru/questions/b961576d6c4142fdb2253d8a17b4930a/chto-vyvedet-na-konsol-dannyj-kod-public-class-test-public-void-checkcase-int-i-#20517","text":"Ничего не будет выведено","dateCreated":"2020-02-06","upvoteCount":0}]}