Loading...
Set Up Java Development Environment (JDK 21 + VS Code)
Install JDK 21 and Visual Studio Code, then verify Java works by running both `java -version` and `javac -version` in your terminal.
Importance of Java Virtual Machine (JVM)
List the advantages of using the Java Virtual Machine. Explain how JVM contributes to Java's platform independence and security features.
Explain Naming Conventions in Java
Describe the standard naming conventions for classes, methods, variables, and constants in Java. Provide examples of each.
Variables in Java
Define a variable in Java and explain the three types: local, instance, and static variables. Write a single Java program that demonstrates all three types with appropriate output.
Constants in Java
Explain what a constant is in Java and how it is declared using the final keyword. Write a program that declares constants for PI (3.14159) and MAX_SPEED (120), uses them in a calculation, and attempts to reassign one — then explain what error occurs and why.
Primitive Data Types in Java
List all eight primitive data types in Java with their size in bytes and value range. Write a Java program that declares one variable of each type, assigns a valid value, and prints each variable with a descriptive label.
Type Casting in Java
Research and explain the concept of type casting in Java. What is the difference between widening and narrowing conversion? List two real-world scenarios where each type of casting would be used. No coding required — write your answer in your own words.
Operator Categories and Examples
Write brief notes on arithmetic, relational, logical, assignment, unary, and ternary operators in Java. For each category, provide at least two operator symbols and one short example expression.
Console Output Practice with println, print, and printf
Write a Java program that displays your name, program, semester, and a formatted marks table using print, println, and printf. Use printf formatting for aligned columns and two decimal places where needed.
User Input with Scanner
Create a Java program that reads student name, age, and three subject marks from the keyboard using Scanner. Display the input back with total and percentage in a clean formatted report.
Mini Input-Output Calculator
Build an interactive calculator that asks the user for two numbers and an operator (+, -, *, /, %), then displays the result with a meaningful message. Handle division by zero with a user-friendly output.
Command Line Argument Parser
Write a Java program that accepts command line arguments for student name, roll number, and marks in three subjects. Display the inputs, calculate total and percentage, and print a formatted result. Handle missing arguments by showing a clear usage message.
Decision Making with if, if-else, and switch
Write a Java program that accepts a student's percentage and prints the division or grade using if-else-if. Then extend the same program to display a course category message using a switch statement based on a user-entered letter grade.
Loop Practice with for, while, and do-while
Create three separate Java programs to demonstrate for, while, and do-while loops. Use them to print the first 20 natural numbers, and the sum of odd numbers from 1 to 20.
Array Declaration, Initialization, and Traversal
Write a Java program that declares an integer array of size 5, initializes it with user input, and then displays the elements using a for loop. Calculate and print the sum and average of all elements.
Finding Min, Max, and Average in Arrays
Create a program that accepts 10 integers into an array. Find and display the minimum value, maximum value, and average. Also count how many elements are greater than the average.
Array Searching and Sorting
Implement a program that stores marks of 5 students in an array. Implement search to find if a specific mark exists. Then sort the array in ascending order and display the sorted marks.