Viva Questions - Class 8 - Programming

Viva Questions — Programming (Java & BlueJ)
Be Confident, Be Prepared, Shine in Your Viva! This complete guide contains 20 essential Viva Questions and Answers for your Programming oral exam. Read carefully, practice speaking aloud, give examples, and you'll ace your viva!
Introduction
A Viva Voce is an oral examination where your teacher tests your understanding through spoken questions. Programming viva covers Java basics — variables, data types, operators, input/output, and BlueJ IDE.
Motivational Tip
Your viva is a friendly conversation about programming. You've written programs, you know Java — now just speak it out! Take a deep breath, smile, and show what you've learned.
What is Programming?
Programming is the process of writing instructions in a language that a computer can understand and execute to perform tasks.
Key Points to Remember
Essentials
- ✅ Java is a programming language.
- ✅ BlueJ is an IDE for Java beginners.
- ✅ Variables store values.
- ✅ Data types define variable type.
- ✅ Operators perform operations.
- ✅ Scanner for input, println for output.
- ✅ Compilation converts code to bytecode.
- ✅ Programs solve real problems.
20 Viva Questions and Answers
Question 1
What is programming?
Answer: Programming is the process of writing instructions in a programming language that a computer can understand and execute to perform a task.
Question 2
What is Java?
Answer: Java is a high-level, object-oriented programming language used to develop applications for computers, smartphones, and web.
Question 3
Who invented Java?
Answer: Java was invented by James Gosling in 1995 at Sun Microsystems.
Question 4
What is BlueJ?
Answer: BlueJ is an Integrated Development Environment (IDE) designed specifically for teaching Java programming to beginners.
Question 5
What is IDE?
Answer: IDE stands for Integrated Development Environment — a software that provides tools like editor, compiler, and debugger to write and run programs.
Question 6
What is a variable?
Answer: A variable is a
named storage location in memory that
holds a value which can be changed during program
execution.
Example: int age = 15;
Question 7
Name any 5 data types in Java.
Answer:
int— whole numbersdouble— decimal numberschar— single characterString— textboolean— true or false
Question 8
What is int data type?
Answer: int stores
whole numbers (integers) like 5, -10,
100, 2500.
Example: int age = 15;
Question 9
What is double data type?
Answer: double stores
decimal numbers (numbers with fractional
part) like 3.14, 99.99.
Example: double price = 99.99;
Question 10
What is boolean data type?
Answer: boolean stores
only two values: true or
false.
Example: boolean isPass = true;
Question 11
What is an operator?
Answer: An operator is a
symbol that performs an operation on
one or more values (called operands).
Example: +, -,
*, /
Question 12
Name the arithmetic operators.
Answer:
+— Addition-— Subtraction*— Multiplication/— Division%— Modulo (remainder)
Question 13
What is the difference between = and ==?
Answer:
=is assignment — assigns a value.==is comparison — checks if two values are equal.
Question 14
What is % operator?
Answer: The % (modulo)
operator gives the remainder after
division.
Example: 10 % 3 = 1
(because 10 ÷ 3 = 3 remainder 1)
Question 15
What is Scanner in Java?
Answer: Scanner is a built-in
class in Java used to take input from the user.
Import: import java.util.Scanner;
Usage: Scanner sc = new Scanner(System.in);
Question 16
How do we print output in Java?
Answer: We use
System.out.println() to print output to
the console.
Example:
System.out.println("Hello, World!");
Question 17
What is compilation?
Answer: Compilation is the process of converting source code (Java code) into bytecode (machine-readable language) so the computer can execute it.
Question 18
What is an identifier?
Answer: An identifier is a
name given to a variable, class,
method, or object in a program.
Examples: studentName,
HelloWorld, calculateSum
Question 19
What are the rules for naming identifiers?
Answer:
- Must start with a letter,
_, or$. - Cannot start with a number.
- Cannot contain spaces or special characters (except _ and $).
- Cannot be a Java keyword (like
int,class). - Case-sensitive (name and Name are different).
Question 20
What is the basic structure of a Java program?
Answer: A Java program has:
- A class declaration
- A main() method
- Statements inside main
public class ClassName {
public static void main(String[] args) {
// statements
}
}
Quick Code Examples
Example 1: Hello World Program
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Example 2: Add Two Numbers
import java.util.Scanner;
public class AddNumbers {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter first number: ");
int a = sc.nextInt();
System.out.print("Enter second number: ");
int b = sc.nextInt();
int sum = a + b;
System.out.println("Sum = " + sum);
}
}
Example 3: Variables and Data Types
int age = 15;
double marks = 95.5;
char grade = 'A';
String name = "Ravi";
boolean isPass = true;
System.out.println("Name: " + name);
System.out.println("Age: " + age);
System.out.println("Marks: " + marks);
System.out.println("Grade: " + grade);
System.out.println("Passed: " + isPass);
Viva Preparation Tips
Before the Viva
- 📖 Understand concepts, don't just memorize.
- 🎤 Practice speaking answers aloud.
- 💬 Give examples for each concept.
- 💻 Show sample code when asked.
- 😊 Be confident and smile.
- 🙋 Ask if you don't understand.
- 🙏 Thank the teacher after viva.
- 📚 Review your practical activities.
- 🖥️ Recall your BlueJ programs.
- 💪 Believe in yourself!
During the Viva
Confidence Tips
- 😊 Smile and greet politely.
- 👂 Listen to the full question.
- 💭 Take a moment to think.
- 🎤 Speak clearly and confidently.
- 👀 Maintain eye contact.
- 🎯 Give short, focused answers.
- 💻 Give code examples when possible.
- 🙏 Say "I'm not sure" if unsure — don't guess wildly.
- 💪 Stay calm if you make a mistake.
- 🙌 Thank the teacher at the end.
Common Mistakes to Avoid
Don't Do These!
- ❌ Missing semicolons in code examples.
- ❌ Wrong case in Java (System vs system).
- ❌ Not knowing the difference between = and ==.
- ❌ Forgetting to import Scanner.
- ❌ Confusing print with println.
- ❌ Not giving examples.
- ❌ Being too nervous.
- ❌ Guessing wildly when unsure.
Bonus Viva Questions
Extra Practice
- Q. What is JVM? → Java Virtual Machine — runs Java bytecode.
- Q. What is JDK? → Java Development Kit — tools for developing Java.
- Q. What is JRE? → Java Runtime Environment — required to run Java.
- Q. What is bytecode? → Intermediate code produced after compilation.
- Q. What is a class? → A blueprint for creating objects.
- Q. What is a method? → A block of code that performs a task.
- Q. What is main() method? → The entry point of a Java program.
- Q. What are keywords? → Reserved words with special meaning (like int, class).
- Q. What are comments? → Notes in code that are ignored by compiler.
- Q. Types of comments? → Single-line (//), Multi-line (/* */).
Did You Know?
Fun Fact
Java runs on over 3 billion devices worldwide! From your smartphone to smart TVs, from banking systems to space exploration software — Java is everywhere. It was named after Java coffee, and that's why its logo is a coffee cup!
Sample Viva Conversation
Teacher: "Good morning! What is
programming?"
You: "Good morning, ma'am. Programming
is the process of writing instructions in a programming
language that a computer can understand and execute."
Teacher: "Very good. Can you name a
programming language?"
You: "Yes, ma'am. Java is a popular
programming language. We are learning it in BlueJ IDE."
Teacher: "What is a variable in Java?"
You: "A variable is a named storage
location in memory that holds a value. For example,
int age = 15; — here age is
the variable that stores 15."
Teacher: "Excellent! What data types
do you know?"
You: "int for whole numbers, double
for decimals, char for single characters, String for
text, and boolean for true/false."
Teacher: "Well done!"
FAQs About Viva
Q1. How long is the viva?
Usually 5-15 minutes per student, covering key concepts.
Q2. What if I don't know an answer?
Say politely: "I'm not sure, ma'am/sir" — better than guessing wildly.
Q3. Should I memorize code?
Understand the logic. Practice writing simple examples like Hello World and Add Two Numbers.
Q4. Can I show code on paper?
Only if teacher asks or provides paper. Otherwise, explain verbally with syntax.
Q5. Should I explain step-by-step?
Yes! Explaining shows understanding. Break down complex answers.
Q6. What if I forget the exact term?
Describe it in your own words. Teachers appreciate understanding.
Q7. How do I overcome nervousness?
Deep breaths, practice with friends, remember you know this stuff!
Q8. What if I make a mistake?
Correct yourself politely: "Actually, I think it's..." — shows self-awareness.
Key Takeaways
- Java is a programming language.
- BlueJ is Java IDE for beginners.
- Variables store values.
- Data types: int, double, char, String, boolean.
- Operators: arithmetic (+ - * / %), assignment (=).
- Scanner for input; System.out.println for output.
- Compilation converts code to bytecode.
- Class names start with uppercase.
- Understand concepts, don't just memorize.
- Be confident, give examples, smile!
Key Takeaway
Prepare well, be confident, and speak clearly!
You will shine in your viva!
Programming is a valuable skill in today's digital world.
Your Java viva is a chance to show what you've learned.
Answer confidently, give examples, and enjoy the
conversation!
Remember: Learn Today, Lead Tomorrow!
Practice Makes Perfect! 🌟
⭐ CODE SMART, THINK CLEAR, WRITE BETTER! ⭐
Best of Luck! Take a deep breath.
Smile. Answer confidently. You will do great! 👍😊
Flowchart → Visual Thinking → Smart Solutions → Better
Results! 🚀
Home & Online Tuition
Learn from an experienced tutor with personalized guidance.
Available Locations
Expert Home & Online Tuition
Personalized one-to-one tuition that focuses on concept building, practical learning, problem-solving skills, and excellent academic performance. Suitable for school students looking for structured, interactive, and result-oriented learning.
Subjects We Teach
Why Choose Our Tuition?
✅ Concept-Based Learning
✅ Practical Examples
✅ Weekly Tests
✅ Doubt Solving Sessions
✅ Practice Worksheets
✅ MCQ & Assignments
✅ Exam Preparation
✅ Flexible Class Timings