Skip to content

Instantly share code, notes, and snippets.

@rana01645
Created March 5, 2023 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rana01645/8ec884a381b2423a050a562a9e42f533 to your computer and use it in GitHub Desktop.
Save rana01645/8ec884a381b2423a050a562a9e42f533 to your computer and use it in GitHub Desktop.
ChatGPT Use Cases
1. Transform code from one language to another
Prompt:
Write this code in Java
<?php
class Animal
{
public $name;
public $breed;
public function __construct($name, $breed)
{
$this->name = $name;
$this->breed = $breed;
}
public function greet()
{
return "Hello ! My name is " . $this->name . " and I am a " . $this->breed . "<br>";
}
} // class Animal
class Dog extends Animal
{
public function play()
{
return $this->name . " loves to play.<br>";
}
} //class Dog
$dog = new Dog("Max", "Labra");
echo $dog->greet();
echo $dog->play();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment