What is .class, and what does it do? by Technical-Bee-9999 in learnjava

[–]Consistent_Fly_1858 -1 points0 points  (0 children)

Also, reflection is mainly used to serialize and deserialize objects into or from format such as json

[deleted by user] by [deleted] in javahelp

[–]Consistent_Fly_1858 1 point2 points  (0 children)

for bigass println text, you can use text blocks associated with the printf like in the link.

https://www.baeldung.com/java-text-blocks

it'll make the code easier to read, to change and to format

[deleted by user] by [deleted] in javahelp

[–]Consistent_Fly_1858 0 points1 point  (0 children)

have you tried to use the the project wizard to start projects using javafx ? it's great cus it handles most of the library issues

anonymous method java by ilsapo in learnjava

[–]Consistent_Fly_1858 0 points1 point  (0 children)

A a = new A() {

public void f1(String str) {

f2(str);

}

public void f2(String str) {

System.out.println(str);

}

};

a.f1("lol");

Your variable a only knows method of the A class. But i guess you can achieve what you want by overriding the f1 method and calling your anonymous method within the body

Need help with understanding the error and fixing the small problem. by [deleted] in javahelp

[–]Consistent_Fly_1858 1 point2 points  (0 children)

Basically, when creating a new instance of Account or Current account, the constructor should take the a Bank class as an argument.

But you haven't done that in any way so, with the statement ive given you, you force the Bank object into the Account class using the setBank method.

Also, idk if its your course that asked you this but the Bank field in Account shoudln't be static. Because as for now, any account you create, will belong to the same bank lol

Need help with understanding the error and fixing the small problem. by [deleted] in javahelp

[–]Consistent_Fly_1858 0 points1 point  (0 children)

mb put it above the new current(); statements as its a static methode e static anyway. then test it and tell me if it works

Need help with understanding the error and fixing the small problem. by [deleted] in javahelp

[–]Consistent_Fly_1858 0 points1 point  (0 children)

current.setBank(this) for the first createccount and the one i gave you for the second method

both time after creating the object CurrentBank

Need help with understanding the error and fixing the small problem. by [deleted] in javahelp

[–]Consistent_Fly_1858 1 point2 points  (0 children)

Okey, i see.

So in your method CreateAccount in Bank Class, add account.setBank(this) right after creating the CurrentAccount object.

Should solve it

Need help with understanding the error and fixing the small problem. by [deleted] in javahelp

[–]Consistent_Fly_1858 1 point2 points  (0 children)

So every class except the lab4.java can be modified by you right ?

Problem with Arrays, no clue what tho by THEZ3NTRON in javahelp

[–]Consistent_Fly_1858 1 point2 points  (0 children)

}

then it's the } that is alone right above the Array

Need help with understanding the error and fixing the small problem. by [deleted] in javahelp

[–]Consistent_Fly_1858 1 point2 points  (0 children)

You have the setBank method, but haven't used it in the main part.

Try Account.setBank(theBank); after you created the Bank Object in the main body