0% found this document useful (0 votes)
23 views9 pages

Java Virtual Lab Experiments Guide

This document describes two virtual lab experiments for learning object-oriented programming concepts in Java. The first experiment teaches encapsulation through creating a package, class, and method, then importing and executing the package. The second experiment teaches inheritance by creating a base class, subclass that inherits from the base class, creating an object of the subclass, and executing the program. Both experiments provide step-by-step procedures to simulate and understand the concepts through virtual experiments.

Uploaded by

sharath20038
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)
23 views9 pages

Java Virtual Lab Experiments Guide

This document describes two virtual lab experiments for learning object-oriented programming concepts in Java. The first experiment teaches encapsulation through creating a package, class, and method, then importing and executing the package. The second experiment teaches inheritance by creating a base class, subclass that inherits from the base class, creating an object of the subclass, and executing the program. Both experiments provide step-by-step procedures to simulate and understand the concepts through virtual experiments.

Uploaded by

sharath20038
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

VIRTUAL LAB EXPERIMENTS

LEARNING ENCAPSULATION THROUGH PACKAGES

AIM:

PROCEDURE:
STEP TO BE FOLLOWED:

STEP 1: CREATE PACKAGE

STEP 2: CREATE METHOD INSIDE OF THE CLASS:


STEP 3: IMPORT PACKAGE

STEP 4: CREATE AN OBJECT FOR CLASS


STEP 5: EXECUTE THE PROGRAM

RESULT:

Thus the simulation program for learning Encapusulation through


Package.
UNDERSTANDING INHERITANCE IN JAVA

AIM:

PROCEDURE:
SIMULATION:

STEP 1: TO START EXPERIMENT

STEP 2: CREATE BASE CLASS


DECLARE THE VARIABLES IN BASE CLASS

STEP 3: CREATE SUB CLASS


STEP 4: DECLARE THE VARIABLES IN SUBCLASS

STEP 5: CREATE AN OBJECT FOR SUB CLASS


STEP 6: EXECUTE THE PROGRAM

RESULT:

Thus the simulation program for understanding inheritance in java has


been executed successfully.

You might also like