I just began to learn Java.
My friend who is helping me study just sent me this and said 'figure this out'.
Unfortunately I am unable to read this. It looks like Perl to me.
class _{_ _;_(){_=this;}}
What does it mean?
In Java SE 7 and later, any number of underscore characters ( _ ) can appear anywhere between digits in a numerical literal. This feature enables you, for example, to separate groups of digits in numeric literals, which can improve the readability of your code.
In earlier versions of Java, the underscore ("_") has used as an identifier or to create a variable name. Since Java 9, the underscore character is a reserved keyword and can't be used as an identifier or variable name.
_
is the class name. It's a very confusing one, but it works!
With the class renamed:
class Something {Something something;Something(){something=this;}}
And cleaned up:
class Something { Something something; Something() { something=this; } }
And you can go crazy with this odd naming :)
class _{_ __;_ ____;_(){__=this;____=__;}_(_ ___){__=___;}}
In fact, Unicode is even supported, so this is valid:
class 合法類別名稱{合法類別名稱(){}}
_
is the class name, underscore is a valid Java variable name, you just need to indent your code to deobfuscate it:
class _{ _ _; _(){ _=this; } }
Like:
class A{ A A; A(){ A=this; } }
Edit: thanks to @Daniel Fischer
Type names and variable names have different namespaces. and for example code
class FOO { FOO FOO; }
is valid in Java.
Summary
_
is a class name e.g at class _{
_
is a class member name e.g at _ _;
and _=this
_
is a constructor name e.g. at _()
Remember: Java uses six different namespaces:
- Package names,
- type names,
- field (variable) names,
- method names,
- local variable names (including parameters), and
- labels.
In addition, each declared enum has its own namespace. Identical names of different types do not conflict; for example, a method may be named the same as a local variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With