Java Basic: Exercise-1 with Solution

 


Write a Java program to print 'Hello' on screen and then print your name on a separate line.
Sample Solution:
Java Code:
public class Exercise1 { 
 public static void main(String[] args) {
  System.out.println("Hello\nAlexandra Abramov!");
 }
 }

Sample Output:


Hello                                                                                                      

Alexandra Abramov!


Post a Comment

0 Comments