Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
College aantekeningen

Introduction to Java — Methods & Static Functions

Beoordeling
-
Verkocht
-
Pagina's
14
Geüpload op
18-05-2026
Geschreven in
2025/2026

This lab manual covers Java static methods — how to define them, pass parameters, return values, and call them from main. You will practice void methods that print results directly, methods that return computed values, methods that work with String objects, and methods with multiple parameters. Each task is fully solved with corrected code, expected output, and step-by-step explanation.

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

Java Programming Lab Manual — Methods & Static Functions Page 1 | Original Work | For Educational Use Only




JAVA PROGRAMMING
Lab Manual — Methods & Static Functions



Subject Static methods, parameters, return types, String methods, Scanner

Level Beginner to Intermediate

Tasks 6 Fully Solved Tasks with Corrected Code & Output

Concepts void methods, return values, String, Math, Scanner, method calls

Language Java

Format Study Reference / Lab Guide



Disclaimer: This document is intended as a study reference and learning guide only. All solutions are original
work. Please use responsibly for educational purposes.




Original Work | For Educational Use Only

, Java Programming Lab Manual — Methods & Static Functions Page 2 | Original Work | For Educational Use Only




Introduction to Java — Methods & Static Functions
This lab manual covers Java static methods — how to define them, pass parameters, return values, and call
them from main. You will practice void methods that print results directly, methods that return computed
values, methods that work with String objects, and methods with multiple parameters. Each task is fully
solved with corrected code, expected output, and step-by-step explanation.

Core Concepts at a Glance
Concept Syntax Purpose

void method public static void name(params){ } Performs action, returns nothing

return method public static int name(params){ return x; } Computes and returns a value

method call name(args); or int r = name(args); Executes the method

String param public static void name(String s){ } Pass text to a method

int param public static void name(int n){ } Pass number to a method

String.length() word.length() Number of characters in string

String.charAt(n) word.charAt(n) Character at position n (0-based)

type casting (int) seconds / 3600 Convert double to int


What You Will Learn
■ Write a void method that checks if a number is prime.
■ Write a void method that converts seconds to hours, minutes, seconds, and milliseconds.
■ Write a method that counts vowels and measures String length.
■ Write a method that calculates area and perimeter of a square or parallelogram.
■ Write a method that extracts first, last, and positional characters from a String.
■ Write a two-method program using getInput() and printInput() with parameter passing.




Original Work | For Educational Use Only

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
18 mei 2026
Aantal pagina's
14
Geschreven in
2025/2026
Type
College aantekeningen
Docent(en)
Prof. saleh imtiaz
Bevat
Alle colleges

Onderwerpen

$8.49
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
KinzaAsif

Maak kennis met de verkoper

Seller avatar
KinzaAsif GIFT University
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
1 week
Aantal volgers
0
Documenten
12
Laatst verkocht
-
Learnly

Welcome to Learnly! High-quality, organized, and simplified study materials designed to help you ace your exams. My notes focus on breaking down complex concepts, specializing in Programming(Java). Each document is structured for quick revision, featuring clear logic, step-by-step solutions, and simplified summaries of core modules. Save time on note-taking and focus on what matters: mastering the material.

0.0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen