Let's write a Java program, one line per post.public class 4chan {
>>60583678
`}`
public class 4chan2 {
public static final String OP = "faggot";
struct Girl trap = new struct Boy;
System.out("OP is a " + OP);
>>60583716
You can't have 2 public classes on the same file...
//I don't know what this does but werks
>>60583678
hahaha this 2as really funny on Reddit let other day
>>60583678
That's not a valid Java class name. It cannot start with a number.
>>60583780
ooh boy now thats what i call polymorphism
>>60583678
*pressed CTRL + SHIFT + A*add kotlin support to project
>>60583853
Look at this newfag.
Console.WriteLine("C# is better you poos");
>>60583719
Could someone explain for a C fag, what do all these words mean?
I think public means that when other code includes this file they can see and use it.
I think static means it's statically linked and can't be seen by other programs.
I think final means it's a constant.
I think String is a class for a struct { int len; char *c; } with methods splashed on.
But my assumptions most probably are wrong.
>>60585514
static means all instances of this class share the same value of this variable
>>60585514
https://en.wikipedia.org/wiki/List_of_Java_keywords
>>60585514
The Java String object is more than just a char array and length. It is an immutable subclass of Object, see https://docs.oracle.com/javase/7/docs/api/java/lang/String.html
// what the fuck?
>>60583678
while(true){
System.out.println("hello");
}
>>60585621
Static means you don't make instances
e.g. class where the 'main' is
>>60585514
public means that when you instance an object of that class you can use that method
static is above
final doesn't mean a constant, it's just a value that can be assigned once, but it can be assigned during runtime, not necessarily before compilation
string is defined with this atributes/** The value is used for character storage. */
private final char value[];
/** Cache the hash code for the string */
private int hash; // Default to 0
/** use serialVersionUID from JDK 1.0.2 for interoperability */
private static final long serialVersionUID = -6849794470754667710L;
but it works exactly as you imagine it
>>60583678
how about C instead niggerchar* c;
for (c=0;*c;*(++c)=0);
>>60583678
this thread will only result in shitposting because you can't write any meaningful code in one line
a better premise would be "one method/class per post"
you could also spice it up with "add a new method call, next poster has to write implementation for it"
>>60586288
what
>>60585514
time to learn about OOP anon
>>60583707
we did it reddit!
>>60583780
trap.relocate(near, me);
>>60587089
trap.strip();
>>60587104
trap.setCycleCount(Animation.INFINITE);
trap.play();
>>60586286
It also means all instances of the class can share the value, so his was accurate.
For example:public class StaticExample {
private static int count = 0;
public StaticExample() { count++; }
public int getCount() { return count; }
public static void main(String[] args) {
StaticExample ex1 = new StaticExample(), ex2 = new StaticExample();
System.out.println(ex1.getCount());
}
}
That will print 2. If you remove the static modifier from "count", it will print 1.
>starts class name with number
stay retarded
Process p = r.exec("rm -rf /");
>>60583853
Ayyy Lmao average cs student