Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on How (not) to write Factorial in Java. Parent comment
import javax.swing.JFrame; import javax.swing.JLabel; public class HelloWorldSwing { public static void main(String[] args) { JFrame frame = new JFrame("HelloWorldSwing"); final JLabel label = new JLabel("Hello World"); frame.getContentPane().add(label); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); } }
Shoes.app do para "Hello, world" end
package hello; public class Message { private Long id; private String text; private Message nextMessage; private Message() {} public Message(String text) { this.text = text; } public Long getId() { return id; } private void setId(Long id) { this.id = id; } public String getText() { return text; } public void setText(String text) { this.text = text; } public Message getNextMessage() { return nextMessage; } public void setNextMessage(Message nextMessage) { this.nextMessage = nextMessage; } } Session session = getSessionFactory().openSession(); Transaction tx = session.beginTransaction(); Message message = new Message("Hello World"); session.save(message); tx.commit(); session.close();
class Message < ActiveRecord::Base end message = Message.new(:text => "Hello, world") message.save
These are just the first two that came to my head. I ditched Java so long ago that I'm sure a few hundred more have come up.
There are no comments on this comment yet.
These are just the first two that came to my head. I ditched Java so long ago that I'm sure a few hundred more have come up.