JPad
Snippets
Download
Help
Contact
40730590-Java Triangular kind of histogram
http://stackoverflow.com/questions/40730590/java-triangular-kind-of-histogram/40731550#40731550
Code
public static void main(String[] args){ System.out.println("s"); } static void printSpaces(int count) { for (int spaces = 0; spaces < count; spaces++) System.out.print(" "); } static void printTriangleSection(int triangleHeight, int rowOfTriangle) { }
Result
Console
s
Bytecode
Compiled from "RunnContainer.java" public class io.jpad.scratch.RunnContainer { public io.jpad.scratch.RunnContainer(); Code: 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return public static void main(java.lang.String[]); Code: 0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 3: ldc #3 // String s 5: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 8: return static void printSpaces(int); Code: 0: iconst_0 1: istore_1 2: iload_1 3: iload_0 4: if_icmpge 21 7: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 10: ldc #5 // String 12: invokevirtual #6 // Method java/io/PrintStream.print:(Ljava/lang/String;)V 15: iinc 1, 1 18: goto 2 21: return static void printTriangleSection(int, int); Code: 0: return }
Jpad Version:1.07
viewCount:2744
Creator:
mellamokb
Latest Editor:
mellamokb
Tags
Download
Copy As Markdown:
**code [40730590-Java Triangular kind of histogram.java](/example/1G/40730590-java-triangular-kind-of-histogram)** public static void main(String[] args){ System.out.println("s"); } static void printSpaces(int count) { for (int spaces = 0; spaces < count; spaces++) System.out.print(" "); } static void printTriangleSection(int triangleHeight, int rowOfTriangle) { } **Result:** s