Ansari Computer Academy
Course Title: Web Development Test: Java Web
Language
Date: 8-December,2025 Time: 40 mints Total Marks: 32
Task 1 — Java Basics
1. Explain what Java is and write three major features of Java.
2. Write the basic structure of a Java program (class + main method).
3. Explain the difference between print and println.
4. Write a Java program that prints the following three lines:
Welcome to Java!
Java is powerful
Learning Java step by step
Task 2 — Comments + Variables Practice
(Topics Covered: Java Comments, Variables, Output)
1. Write the two types of Java comments with examples (single-line, multi-
line).
2. Create five different variables using these data types:
String, int, double, char, Boolean
3. Write the purpose of each variable type in simple words.
4. Write a Java program that:
Includes comments
Defines these variables
Prints their values
Task 3 — Data Types + Variables Practical Task
(Topics Covered: Data Types, Variables, Syntax)
1. Write the list of primitive and non-primitive data types in Java.
2. Give one example each for:
Int, float, double, boo lean, char.
3. Write a Java program that stores this data:
Student Name (String), Age (int), GPA (double), Grade (char), Is Passed
(Boolean).
4. Print all the information in output.
Task 4 — Mixed Concepts (Full Revision Task)
1. Write five advantages of Java.
2. Explain why class and main method are important in Java.
3. Write a Java program that:
Uses at least six variables
Has a comment above every line explaining what that line does
Prints all values in a neat formatted output
4. Write a short paragraph explaining what you learned from this task.