Questions tagged [object-class]

19 questions
0
votes
1 answer

How can I verify that two classes are assigned to the same city? Follow-up issues

There are three classes with interfaces Train: ITrain, Line: Iline and City: ICity. Generally, I advanced in the code and resolved TEST 3 & 4 but caused new issues. I have following issues: 1. Test 1 on line 19 : "Sequence contains no elements"…
user12525138
-1
votes
2 answers

Does Java Enum Classes by default extend Java Object Class?

I have defined my own enum, which will extend Java Enum Class. Does Java Enum Class extend Java Object Class? enum ORDER { FIRST, SECOND, THIRD, FOURTH }
-3
votes
2 answers

Explanation of toString method output and difference between toString out and hashCode output

public class ObjectClass { public static void main(String[] args) { Demo dm = new Demo(); Object obj = dm.getObject(); System.out.println("Class name :: "+obj.getClass()); System.out.println("To String " +…
Dhiraj
  • 1
  • 1
-6
votes
1 answer

Can we use Object args[] instead of String args[] in main method of java?

Why do we always write this: public static void main(String args[]) As the Object class is a parent class of all the classes in Java, so can we write public static void main(Object args[]) instead of public static void main(String args[]) ?
1
2