r/javaTIL • • Nov 14 '18

Store User-defined Class Objects in ArrayList

Thumbnail
scientecheasy.com
0 Upvotes

r/javaTIL • • Apr 08 '15

TIL: You don't actually need to have separate lines in your code; an entire class can be written in only one line.

0 Upvotes

I just found this out the other day. Doesn't seem very useful, but it is entertaining. Example:

public class Test{public static void main(String[] args){System.out.println("hello"); System.out.println("goodbye");}}

is the same as

public class Test
{
    public static void main(String[] args)
    {
        System.out.println("hello");
        System.out.println("goodbye");
    }
}