Jordan σ_σ
Jordan σ_σ
JCHJava Community | Help. Code. Learn.
Created by Jumong on 1/18/2025 in #java-help
Code Help Please!
how is this java related?
5 replies
JCHJava Community | Help. Code. Learn.
Created by Lumarc on 1/11/2025 in #java-help
Simple Java Trace Code
yes 😅 thanks dan
17 replies
JCHJava Community | Help. Code. Learn.
Created by Lumarc on 1/11/2025 in #java-help
Simple Java Trace Code
I will be butchered for giving the answer here but this is pretty simple just lowkey hate how it is written. Lets break it down though and hopefully the Java Helper Gods can +1 my explanation here: The output is printing System.out.println(myA.doA() + myA.doA2() + myA.a); myA.doA() would be coming from where exactly??? Lets take a look at the object thats being instantiated above the print method. A myA = new B(); Take a look here. We're taking myA as an object thats referencing A but we are practically hooking it into the B class. So our myA object will use B methods. Since the method String doA() { return "b1 "; } overrides the first doA() method from class A. Class B's doA() method will be used or in other words take priority. Why does this happen? Because B class inherits A class. Also given the multiple choice answers thats given it doesn't seem hard to figure that one out given that a2 is being returned from method protected static String doA2() { return "a2 "; } right? So that means that a2 would be the second inputted value yes? And then well...the last one is quite simple as well... myA.a is simply just referring to the object's defined field. If we go back to the code and see where thats at...you'll see its int a = 5 and then well that should answer the question entirely. Hope I don't get butchered for giving out the answer of course...but wanted to explain it thoroughly so you can understand it!
17 replies
JCHJava Community | Help. Code. Learn.
Created by Jordan σ_σ on 5/22/2024 in #java-help
Really confused....
thank you for the help here! Much appreciated
16 replies
JCHJava Community | Help. Code. Learn.
Created by Jordan σ_σ on 5/22/2024 in #java-help
Really confused....
you make a solid point here! I definitely appreciate this so much thank you
16 replies
JCHJava Community | Help. Code. Learn.
Created by Jordan σ_σ on 3/9/2024 in #java-help
Infinite Loop
so make the strings either lowercase or uppercase before delete?
10 replies
JCHJava Community | Help. Code. Learn.
Created by Jordan σ_σ on 3/9/2024 in #java-help
Infinite Loop
So after further investigation...i noticed that when i was iterating through each character through the strings in our array...the delete method was occuring in the context of it deleting/attempting to delete going through each and every character in the array! So now my next question would be is there a way to only allow this delete method to occur even if there are uppercase/lowercase characters??
10 replies