As in Java, sObject and list expressions can be expanded with method references and list expressions, respectively, to form new expressions.
Integer acctNameLength = new Account[]{new Account(Name='Acme')}[0].Name.length();
In the above, new Account[] generates a list.
The list is populated with one element by the new statement {new Account(name='Acme')}.
Item 0, the first item in the list, is then accessed by the next part of the string [0].
The name of the sObject in the list is accessed, followed by the method returning the length name.length().
String nameChange = [SELECT Name FROM Account][0].Name.toLowerCase();