Simple Java project demonstrating device classes (Device, Smartphone, Smartwatch, SmartTV, Tablet) with a Main runner.
- Java JDK 11 or newer installed
From the project root (where these files live), run:
javac *.java
java MainIf your environment uses separate source folders, compile accordingly.
Device.java— base device abstractionSmartphone.java— smartphone implementationSmartwatch.java— smartwatch implementationSmartTV.java— smart TV implementationTablet.java— tablet implementationMain.java— application entry point
- Initialize a local repo (optional):
git init
git add .
git commit -m "Initial commit"- Create a repository on GitHub and push:
git remote add origin https://github.com/USERNAME/REPO.git
git branch -M main
git push -u origin mainReplace USERNAME and REPO with your GitHub username and repo name.
.gitignoreadded to exclude build artifacts and IDE files.