Superdavo0001 | The very basics of Java [Part 1 - Advanced Hello World] @Superdavo0001 | Uploaded 11 years ago | Updated 4 hours ago
My very first video on the subject of programming, in this one, I show you how to make the famous "Hello World!" code, before adding to it - in this case by showing how long it takes to run. Any ideas? Tell me in the description! In the next video, I will probably create a window so the message will actually appear. Please subscribe! I've got a lot of other videos planned! Like space? I have videos for that!
If you are finding this interesting, check out TheJavaHub's tutorials! I got all my knowledge from them.
Sourcecode:
package helloworld;
public class HelloWorld{
//Variables
private long beforeTime, afterTime, diff = 0;
public HelloWorld(){
beforeTime = System.nanoTime();
log("Hello World!");
afterTime = System.nanoTime();
diff = afterTime - beforeTime;
log("Time taken: "+ diff);
}
public static void main(String[] args){
HelloWorld hw = new HelloWorld();
}
public void log(String s){
System.out.println(s);
}
}
My very first video on the subject of programming, in this one, I show you how to make the famous "Hello World!" code, before adding to it - in this case by showing how long it takes to run. Any ideas? Tell me in the description! In the next video, I will probably create a window so the message will actually appear. Please subscribe! I've got a lot of other videos planned! Like space? I have videos for that!
If you are finding this interesting, check out TheJavaHub's tutorials! I got all my knowledge from them.
Sourcecode:
package helloworld;
public class HelloWorld{
//Variables
private long beforeTime, afterTime, diff = 0;
public HelloWorld(){
beforeTime = System.nanoTime();
log("Hello World!");
afterTime = System.nanoTime();
diff = afterTime - beforeTime;
log("Time taken: "+ diff);
}
public static void main(String[] args){
HelloWorld hw = new HelloWorld();
}
public void log(String s){
System.out.println(s);
}
}