(ns clojure.examples.example (:gen-class)) (defn Example [] (def names (ref [])) (defn change [newname] (dosync (alter names conj newname))) (change "John") (change "Mark") (println @names)) (Example)
(ns clojure.examples.example (:gen-class)) (defn Example [] (def names (ref [])) (alter names conj "Mark")) (Example)
(ns Project (:gen-class)) (defn Example [] (println (.. System getProperties (get "java.version")))) (Example)
(ns Project (:gen-class)) (defn Example [] (println (. Math PI))) (Example)
(ns Project (:gen-class)) (import java.util.Stack) (defn Example [] (let [stack (Stack.)] (.push stack "First Element") (.push stack "Second Element") (println (first stack)))) (Example)
(ns Project (:gen-class)) (defn Example [] (def my-int(new Integer 1)) (println (+ 2 my-int))) (Example)
(ns Project (:gen-class)) (defn Example [] (def str1 (new String "Hello")) (println str1)) (Example)
(ns Project (:gen-class)) (defn Example [] (println (.indexOf "Hello World","e"))) (Example)
(ns Project (:gen-class)) (defn Example [] (println (.toUpperCase "Hello World"))) (Example)
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more