📜  Jajo jejo (1)

📅  最后修改于: 2023-12-03 15:31:27.871000             🧑  作者: Mango

Jajo Jejo

Jajo Jejo is a programming language that runs on the Java Virtual Machine (JVM). It is a dynamically-typed, interpreted language that was inspired by Python and Ruby. Jajo Jejo is easy to learn and write, allowing developers to quickly prototype and test their ideas.

Features
Simple Syntax

Jajo Jejo has a simple and easy-to-read syntax. It uses indentation instead of braces to delimit blocks of code, making it similar to Python's syntax. Here is an example of a Jajo Jejo program that prints "Hello, world!":

print("Hello, world!")
Dynamic Typing

In Jajo Jejo, variables do not have to be declared with a specific type. Instead, the type of a variable is determined at runtime based on the value that is assigned to it. This allows for more flexible and dynamic programming. Here is an example of a Jajo Jejo program that demonstrates dynamic typing:

my_var = "Hello, world!"
print(my_var)
my_var = 42
print(my_var)
Object-Oriented Programming

Jajo Jejo is an object-oriented language, which means that everything in the language is an object. Classes and objects can be easily created and manipulated. Here is an example of a Jajo Jejo class that represents a person:

class Person:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def say_hello(self):
        print("Hello, my name is " + self.name)

person = Person("Alice", 25)
person.say_hello()
Interoperability with Java

Since Jajo Jejo runs on the JVM, it can easily interact with Java code. Java libraries can be imported and used in Jajo Jejo programs. Here is an example of a Jajo Jejo program that uses the Java Swing library to create a simple GUI:

import javax.swing.JFrame
import javax.swing.JLabel

frame = JFrame("Jajo Jejo GUI")
frame.add(JLabel("Hello, world!"))
frame.pack()
frame.setVisible(True)
Conclusion

Jajo Jejo is a simple and flexible language that allows developers to quickly prototype and test their ideas. Its dynamic typing and object-oriented features make it easy to write code that is easy to read and maintain. Its interoperability with Java also makes it a powerful tool for building applications on the JVM.