0% found this document useful (0 votes)
2 views1 page

Java Lab1 Handout

The document outlines the objectives and activities for a Java Lab focused on understanding Java structure, output, variables, and input. It includes tasks such as writing a 'Hello World' program, introducing oneself through printed output, and solving a math puzzle involving operator precedence. The lab aims to provide hands-on experience with basic Java programming concepts.

Uploaded by

m1sbahsoom
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)
2 views1 page

Java Lab1 Handout

The document outlines the objectives and activities for a Java Lab focused on understanding Java structure, output, variables, and input. It includes tasks such as writing a 'Hello World' program, introducing oneself through printed output, and solving a math puzzle involving operator precedence. The lab aims to provide hands-on experience with basic Java programming concepts.

Uploaded by

m1sbahsoom
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

Java Lab 1 – Introduction & Basics

Objective: Understand Java structure, output, variables, and input.

Quick Recap (Cheat Sheet) Interactive Activities (Tasks)

class Main {
public static void main(String[] args) {
1. Hello World
[Link]("Hello, Java!"); Write and run your first Java program using the
} structure above. Ensure it compiles and prints
} exactly: Hello, Java!

2. Introduce Yourself
Print your name, roll number, and one hobby on
separate lines. Example output: Mirhazar Khan
Chandio\nR-123\nPhotography

Predict & Run (Puzzle)

[Link](5 + 3 * 2); 3. Math


// What will this in Java(Remember operator precedence)
print?
Declare two integers, compute their sum, and print
the result with a message: "Sum = <value>".

int a = 7; int b = 3; [Link]("Sum = " +

Notes / Output

MK Tech – Java Lab Handout • Single-page, print-ready (A4)

You might also like