If Get link Facebook X Pinterest Email Other Apps - September 13, 2020 package conditionalStatements;public class IfClass { public static void main(String[] args) { int age = 19; if(age >= 18) { System.out.println("You Can Vote"); } }} Get link Facebook X Pinterest Email Other Apps Comments
Pattern 4 - September 13, 2020 package nestedForLoop; import java.util.Scanner; public class Pattern4 { public static void main(String[] agrs) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); for(int i = 1;i<=a ;i++) { for(int j = 1;j<=a-i ; j++) { System.out.print(" "); } for(int j = 1;j<=i ;j++) { System.out.print("x "); } System.out.println(); } } } Read more
Automatic Type Casting - June 24, 2021 package type_casting; public class Type_Casting_narrowing { public static void main(String[] args) { double my_double = 2.8965; System.out.println(my_double); int my_int = (int)my_double; System.out.println(my_int); } } Read more
Variable - June 24, 2021 package data_types; public class Data_Types { public static void main(String[] args) { byte x = 2; System.out.println(x); int age = 10; System.out.println(age); float rate_of_intrest = 2.3f; System.out.println(rate_of_intrest); double rate = 3.1428571; System.out.println(rate); boolean isThisSeriesofcodes = false; System.out.println(isThisSeriesofcodes); char myCharacter = '@'; System.out.println(myCharacter); } } Read more
Comments
Post a Comment