# What will be output of following program? public class Test{public static void main(String[] args){byte b=127; b++; b++; System.out.println(b); } } ? with Answer - Software Engineering Mcqs | ExamZone

> Solved MCQ: What will be output of following program? public class Test{public static void main(String[] args){byte b=127; b++; b++; System.out.println(b); } } ? Correct Answer: B. -127. Verified answer explanation for FPSC, PPSC, MDCAT, NTS, and CSS competitive exam preparation.

---

Tested in Competitive Exams:

- [NTS Test Prep](https://test-prep.blog/exams/nts)
- [FPSC Past Papers](https://test-prep.blog/exams/fpsc)
- [PPSC Solved MCQs](https://test-prep.blog/exams/ppsc)
- [PMDC MDCAT 2026](https://test-prep.blog/exams/mdcat)
- [UET ECAT Prep](https://test-prep.blog/exams/ecat)
- [CSS Central Superior](https://test-prep.blog/exams/css)

- [Software Engineering Mcqs](https://test-prep.blog/categories/software-engineering-mcqs)
Difficulty: Moderate 73% Accuracy

# What will be output of following program? public class Test{public static void main(String[] args){byte b=127; b++; b++; System.out.println(b); } } ?

Direct Answer & Quick Reference

The correct option is **B. -127**.

A. 127

B. -127 **(Correct Answer)**

C. 129

D. -129

Verified Key: B. -127
Solved by 4,988+ students

Verified against official examination board answer keys and standard curriculum textbooks.

- [Previous Question A language in which a program is written on the basic of object?](https://test-prep.blog/mcq/a-language-in-which-a-program-is-written-on-the-basic-of-object-b4d50119-766a-4974-8cc2-fb8f511847e9)
- [Next Question A type of language in which the instruction are written in binary foam is called?](https://test-prep.blog/mcq/a-type-of-language-in-which-the-instruction-are-written-in-binary-foam-is-called-4dd85a5a-ed2c-4b66-9f62-cdff29c2bdc6)

- [Practice More Software Engineering Mcqs MCQs](https://test-prep.blog/quiz/smart?category=software-engineering-mcqs)
- [How We Verify Questions →](https://test-prep.blog/editorial-policy)

## Subject Overview

Explore thousands of solved past paper MCQs for Software Engineering Mcqs categorized with explanations.

- [Browse All Software Engineering Mcqs MCQs →](https://test-prep.blog/categories/software-engineering-mcqs)

## Related Questions

- [A language in which a program is written on the basic of object?](https://test-prep.blog/mcq/a-language-in-which-a-program-is-written-on-the-basic-of-object-b4d50119-766a-4974-8cc2-fb8f511847e9)
- [A type of language in which the instruction are written in binary foam is called?](https://test-prep.blog/mcq/a-type-of-language-in-which-the-instruction-are-written-in-binary-foam-is-called-4dd85a5a-ed2c-4b66-9f62-cdff29c2bdc6)
- [Which one of the following is used to define the structure of the relation, deleting relations and relating schemas?](https://test-prep.blog/mcq/which-one-of-the-following-is-used-to-define-the-structure-of-the-relation-delet-5789fd05-ddf9-408c-9917-3356817aa142)
- [Handshaking is a ?](https://test-prep.blog/mcq/handshaking-is-a-dbbb9828-738f-4881-afe0-aab67ed22130)
- [FTP best matches with which OSI layer ?](https://test-prep.blog/mcq/ftp-best-matches-with-which-osi-layer-b68b751a-afc1-4f9f-9242-0fb866d08edc)

---
*Source: https://test-prep.blog/mcq/what-will-be-output-of-following-program-public-class-testpublic-static-void-mai-a68e4b6d-85c1-43c0-b129-c3118402cf70*
*Format: Markdown for Agents (Content Negotiation: text/markdown)*
