This repository contains the experiments performed during the Java Lab in the 4th semester of my B.Tech (CSE).
- Java
- IntelliJ IDEA
Typical structure in this repo:
Java/(or your main lab folder)com/company/- Java packagecom.company\*.java- individual experiment programs (each usually has amainmethod)
.gitignore(at project root and/or inside folders as needed)README.md
Note: Java package folders must match the package name inside the file (example:
package com.company;should be located incom/company/).
- Open the project in IntelliJ IDEA.
- In the Project view, go to
com/company/. - Open any experiment
\*.javafile that containspublic static void main(String[] args). - Click the green Run icon near
main(or right-click the file -> Run).
From the folder that contains com/:
- Compile (example using one file):
javac com/company/YourClassName.java
- Run:
java com.company.YourClassName
Replace YourClassName with the class you want to execute.
This folder includes multiple Java lab experiments such as:
- Constructors in Java (default, parameterized, copy)
- Basic OOP concepts (classes, objects, methods)
- Input/output using
System.out.println - Additional lab programs added over the semester
- Keep file name and
public classname the same (example:Sample.javamust containpublic class Sample). - Keep each experiment inside the correct package folder (example:
com/company/). - Some files may be intentionally ignored via
.gitignore(example: local helper files).
- yashika-kumari