I am a newbie in Java, although I have knowledge of Object Oriented Programming from Python but I’m currently having problem understanding this example on creating public class either combining the …
Tag: class
What is the purpose of a static method in interface from Java 8?
Why are static methods supported from Java 8? What is the difference between the two lines in main method in below code? package sample; public class A { public static void doSomething() { …
Does a class without methods have a special name?
What is a class without methods called? I’m trying to understand and learn about classes, so i have the following class “Variables” that doesn’t have methods, only fields, like the field “Server” in a folder called “utilities”: then this class is called from a method in another class located in another folder or package this way: is this (the without
The object-oriented approach to a many-to-many relationship
I’m battling at the moment in trying to understand how to approach this issue in an object-oriented way. With a many-to-many relationship such as Students-Subjects, where each student gets a mark for a certain subject, assuming the following: I want to be able to display all the marks for a given student. I want to display all the marks from
An interface with different method parameters
I want to declare an interface be use with several classes this classes have method with different parameters interface: class A: class B: how to impelement of this interface? Answer you could make an operand-object or
Java ClassLoader: load same class twice
I have a ClassLoader which loads a class compiled by JavaCompiler from a source file. But when I change the source file, save it and recompile it, the ClassLoader still loads the first version of the …
Java: can you cast Class into a specific interface?
I’ve got a project I am working on and in this project I would like to include the ability for developers to include their own plugins without having to change the whole code. This is what I have …
What is this: [Ljava.lang.Object;?
I get this when I call toString on an object I received from a function call. I know the type of the object is encoded in this string, but I don’t know how to read it. What is this type of encoding …
Problem with Inner Class. Illegal Start of Expression error
I am practicing using inner classes but am having difficulty with a homework question: It is as follows: Create a Swing component class BetterButtons that extends JPanel and has three Jbutton …
Find a class somewhere inside dozens of JAR files?
How would you find a particular class name inside lots of jar files? (Looking for the actual class name, not the classes that reference it.)