gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f292029)
raw | patch | inline | side by side (parent: f292029)
author | Doni Pracner <quinnuendo@gmail.com> | |
Wed, 29 Apr 2015 11:26:15 +0000 (13:26 +0200) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Wed, 29 Apr 2015 11:26:15 +0000 (13:26 +0200) |
kodovi/skup/OpstiTipoviPrimeri.java | [new file with mode: 0644] | patch | blob |
diff --git a/kodovi/skup/OpstiTipoviPrimeri.java b/kodovi/skup/OpstiTipoviPrimeri.java
--- /dev/null
@@ -0,0 +1,32 @@
+class Cuvar<T> {
+ T info;
+
+ public String toString(){
+ return "Cuvam:" + info;
+ }
+
+ public Cuvar(){
+ info = null;
+ }
+
+ public Cuvar(T podatak){
+ this.info = podatak;
+ }
+}
+
+
+public class OpstiTipoviPrimeri {
+
+ public static void main(String[] args) {
+ Cuvar<String> st = new Cuvar<String>();
+ st.info = "neki string";
+ System.out.println(st);
+
+ Cuvar<Integer> broj = new Cuvar<Integer>();
+ broj.info = 5;
+ System.out.println(broj);
+
+ Cuvar<Double> realan = new Cuvar<Double>(5.0);
+ System.out.println(realan);
+ }
+}