Hello, i am an super lazy developer if you don't know me, i used to make scratch programs, but i quit scratch and started to do actual coding. one programming language that catched my eyes was java, java is super powerful and really cool, i highly recomend it.
Anyways firstly of course we are gonna make the basic stuff which activates the code, here is a tip, at every end of each code, always use a semicolon(;) anyways after doing some stuff i used the main method, which is the method that activates the program. in the main method i used a code to tell people what side is the coin using the following script:
System.out.println("1 is Head, 0 is Picture");
now we want to set up an integer using the int command, and we will use Math.random for the number to be completly random
kinda like this
int random = (int)(Math.random() * 2);
Now we want to print out the result of 1 or 0 by using System.out.println.
Like this:
System.out.println(random);
And there we go! that is how i made my first program in java! thanks for reading, stay thicc, and peace out.
0 comments