Answers for "hellowolrd java"

46

hello world java

public class Main {

  public static void main(String[] args) {
  	System.out.println("Hello, World!"); 
  }
  
}
Posted by: Guest on April-29-2020
0

hello world in java

import javax.swing.JFrame;  //Importing class JFrame
import javax.swing.JLabel;  //Importing class JLabel
public class HelloWorld {
    public static void main(String[] args) {
        JFrame frame = new JFrame();           //Creating frame
        frame.setTitle("Hi!");                 //Setting title frame
        frame.add(new JLabel("Hello, world!"));//Adding text to frame
        frame.pack();                          //Setting size to smallest
        frame.setLocationRelativeTo(null);     //Centering frame
        frame.setVisible(true);                //Showing frame
    }
}
Posted by: Guest on June-07-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language