0% found this document useful (0 votes)
26 views2 pages

Java Unit1 1mark Questions

The document contains a series of 1-mark questions and answers related to Java programming. It covers topics such as the purpose of Java, its robustness, OOP principles, simple Java program output, data types, variable scope, operators, arrays, and control statements. Each question is followed by a concise answer, providing essential information for understanding Java fundamentals.

Uploaded by

hamsikagoteti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views2 pages

Java Unit1 1mark Questions

The document contains a series of 1-mark questions and answers related to Java programming. It covers topics such as the purpose of Java, its robustness, OOP principles, simple Java program output, data types, variable scope, operators, arrays, and control statements. Each question is followed by a concise answer, providing essential information for understanding Java fundamentals.

Uploaded by

hamsikagoteti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Java Unit 1 - Scenario Based 1-Mark Questions

Q1. Overview of Java


Ravi is curious to know why Java was developed. What was the main objective behind creating Java?

Answer: To develop a platform-independent programming language that runs on any device using the

concept 'Write Once, Run Anywhere'.

Q2. Java Buzzwords


Sneha read that Java is robust'. What does this mean?

Answer: Java is robust because it handles errors effectively and has strong memory management.

Q3. OOP Principles


A student wants to hide class data and allow access only through methods. Which OOP principle is this?

Answer: Encapsulation.

Q4. Simple Java Program


What is the output of this code?

System.out.println("Hello Java!");

Answer: Hello Java!

Q5. Data Types


Which data type is suitable to store a student's percentage marks?

Answer: float or double.

Q6. Variables Scope


Where is a variable declared inside a method accessible?

Answer: Only within that method.

Q7. Operators
What will be the output of 5 + 3 * 2 in Java?

Answer: 11.

Q8. Arrays
Which data structure is best to store marks of 5 students?

Answer: Array.

Q9. Control Statements


Which statement is used to execute a block only if a condition is true?
Answer: if statement.

You might also like