scjp
scjp passing object
public class Hotel { private int roomNr; public Hotel(int roomNr) { this.roomNr = roomNr; } public int getRoomNr() {[详细]
2023-04-05 01:23 分类:问答Overloading methods with var-args - combined with boxing and widening
When overloading methods that contain parameters that dont match, the JVM will always use the method with the smallest argument that is wider than the parameter.[详细]
2023-03-27 20:00 分类:问答Why can't we pass a instance variable to the super class constructor? [duplicate]
This question already has answers here: Closed 11 years ago. Possible Duplicate: Cannot refer to a instance method while explicitly invoking a constructor[详细]
2023-03-25 10:33 分类:问答Can I have someone verify my collections for the SCJP Exam
I\'ve been studying for the SCJP, now Oracle Certified Professional Java SE Programmer exam. I\'ve had a difficult time wrapping my head around all the different collections and when to use them. I\[详细]
2023-03-24 05:48 分类:问答Java - Thread join() and order of execution SCJP question?
I\'ve been doing some practice for my O/SCJP exam. Consider the following code: public class Cruiser implements Runnable {[详细]
2023-03-23 16:06 分类:问答Synchronized threads and locking
Can someone please explain the difference between these two examples in the context of object locking:[详细]
2023-03-22 08:30 分类:问答Java wildcard strange behaviour when class is generic
I thought that i have some good understanding of Java generics. This code DOES NOT COMPILE and I know why.[详细]
2023-03-06 03:15 分类:问答SCJP v6 (Sierra,Bates) Chapter 2, Question 12 Interpretations of constructor calls
Could I have some feedback on this Given \"new House(\"x \")\" sends a string I had expected that the \"House(String name)\" constructor would have called the Building super class constructor \"Build[详细]
2023-02-26 01:03 分类:问答SCJP Sierra Bates Chapter 2 Question 2 Default constructor calls
Background info I have a query regarding a questions from Sierra & Bates, SCJP v6 book. Namely Chapter 2 question 2. The answer given is that the \"compilation fails\". However when I tried this i[详细]
2023-02-26 00:53 分类:问答SCJP: Program not terminating after uncaught exception
public class Threads2 implements Runnable { 开发者_JAVA百科public void run() { System.out.println(\"run.\");[详细]
2023-02-23 07:58 分类:问答