Created
July 6, 2026 15:33
-
-
Save thinkphp/ea7eb20e240a1302081b9c886df0e6ce to your computer and use it in GitHub Desktop.
Clasa interioara
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Car { | |
| private String model = "TESLA"; | |
| class Engine { //clasa interioara | |
| void start() { | |
| System.out.println("MOtorul porneste pentru " + model); | |
| } | |
| } | |
| } | |
| public class MainInterior { | |
| public static void main(String[] args) { | |
| Car car = new Car(); | |
| Car.Engine engine = car.new Engine();//sintaxa speciala | |
| engine.start(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment