Developing Business Blockchain Applications on Hyperledger IMC Institute
The document provides a comprehensive guide for developing business blockchain applications on Hyperledger using Google Cloud Platform. It details the setup process of an Ubuntu virtual server, installation of Hyperledger Composer and Fabric, and instructions for creating and testing a business network. Additionally, it explains how to generate REST APIs for the business network, complete with sample code and deployment information.
30. ตัว อย่า งโปรแกรม
import java.util.*;
import java.util.*;
public class SampleSet {
public class SampleSet {
public static void main(String args[]) {
public static void main(String args[]) {
Set s = new HashSet();
Set s = new HashSet();
s.add("C#");
s.add("C#");
s.add("Java");
s.add("Java");
s.add("Pascal");
s.add("Pascal");
System.out.println("The size of this set is "+s.size());
System.out.println("The size of this set is "+s.size());
System.out.println("The contents are "+s);
System.out.println("The contents are "+s);
System.out.println("Removing C#");
System.out.println("Removing C#");
31. ตัว อย่า งโปรแกรม
s.remove("C#");
s.remove("C#");
System.out.println("Now this set contains C#: "+
System.out.println("Now this set contains C#: "+
s.contains("C#"));
s.contains("C#"));
s.add("Java");
s.add("Java");
System.out.println("Now the size is "+s.size());
System.out.println("Now the size is "+s.size());
System.out.println("The contents are "+s);
System.out.println("The contents are "+s);
}}
}}
ผลลัพ ธ์ท ไ ด้จ ากการรัน โปรแกรม
ี่
The size of this set is 3
The contents are [Java, Pascal, C#]
Removing C#
Now this set contains C#: false
Now the size is 2
The contents are [Java, Pascal]
33. ตัว อย่า งโปรแกรม
import java.util.*;
import java.util.*;
public class SampleList {
public class SampleList {
public static void main(String args[]) {
public static void main(String args[]) {
List l = new LinkedList();
List l = new LinkedList();
l.add("C#");
l.add("C#");
l.add("Java");
l.add("Java");
l.add("Pascal");
l.add("Pascal");
System.out.println("The size is "+l.size());
System.out.println("The size is "+l.size());
System.out.println("The contents are "+l);
System.out.println("The contents are "+l);
System.out.println("The first one is "+l.get(0));
System.out.println("The first one is "+l.get(0));
34. ตัว อย่า งโปรแกรม
l.add("Java");
l.add("Java");
System.out.println("The contents are "+l);
System.out.println("The contents are "+l);
System.out.println("The index of Java is "+
System.out.println("The index of Java is "+
l.indexOf("Java"));
l.indexOf("Java"));
}}
}}
ผลลัพ ธ์ท ไ ด้จ ากการรัน โปรแกรม
ี่
The size is 3
The contents are [C#, Java, Pascal]
The first one is C#
The contents are [C#, Java, Pascal, Java]
The index of Java is 1
36. ตัว อย่า งโปรแกรม
import java.util.*;
import java.util.*;
public class SampleMap {
public class SampleMap {
public static void main(String args[]) {
public static void main(String args[]) {
Map m = new HashMap();
Map m = new HashMap();
m.put("1","C#");
m.put("1","C#");
m.put("2","Java");
m.put("2","Java");
m.put("3","Pascal");
m.put("3","Pascal");
System.out.println("Removing Pascal");
System.out.println("Removing Pascal");
m.remove("3");
m.remove("3");
System.out.println("The size is "+m.size());
System.out.println("The size is "+m.size());
System.out.println("The first one is "+m.get("1"));
System.out.println("The first one is "+m.get("1"));
37. ตัว อย่า งโปรแกรม
m.put("3","Java");
m.put("3","Java");
System.out.println("The key of this map are "+
System.out.println("The key of this map are "+
m.keySet());
m.keySet());
System.out.println("The contents are "+m.entrySet());
System.out.println("The contents are "+m.entrySet());
}}
}}
ผลลัพ ธ์ท ไ ด้จ ากการรัน โปรแกรม
ี่
Removing Pascal
The size is 2
The first one is C#
The key of this map are [3, 2, 1]
The contents are [3=Java, 2=Java, 1=C#]