Skip to main content

Posts

Showing posts from December, 2023

countdown timer program in java

 Java program that countdown in ten second and then print Happy New Year. simpl e java programs for beginners java programming basics JAVA Programming: Simple Notes  Paperback  Write a java program that countdown in ten second and then print Happy New Year? class ThreadDemo extends Thread {   public static void main(String a[])throws InterruptedException {   for(int time=10;time>0;--time){   System.out.println("second @:"+time);   Thread.sleep(1000); }   System.out.println("HAPPY NEW YEAR"); } } CMD OUTPUT watching onscreen recording video👇  Explanation of the This Java Program This Java program counts down from 10 to 1 and then prints "HAPPY NEW YEAR". 1. Class Declaration `class ThreadDemo extends Thread` The class `ThreadDemo` extends the `Thread` class. However, this program does not create or start a separate thread. 2. Main Method `public static void main(String a[]) throws InterruptedException` The `main()` method is the starting ...

How to run java program in windows 10 using CMD

How to run java program in windows 10 using command prompt How to run java program in notepad and cmd Java is the most popular platform independent computer programming language that operates on the Oops concept. It is a fast, secure, reliable programming language for coding everything from mobile apps and enterprise software to big data applications and server-side technologies. Any computer language requires some software tools to run. Similarly, to run a Java program, you must first install JDK on your system. Then open the notepad and write the Java program.Save the file with the same name given to the class in the Java program and Give the file extension java. Go to the folder, After that, press Alt+D type CMD press enter key CMD will open on that folder. Just type javac file_name.java . If there is an error in the program, it will be displayed on the console If there is no error, if you give the name of the java file Just type java file_name' you will get the output. Ja...