Basics first, then the rest. This principle seems natural enough, but it's not always followed. The reason might be impatience to go to the advanced level. And it is particularly important in software development. Because in this area there are always new languages to learn, new libraries and tools to use, new approaches to apply. And if we constantly learning new, it is easy to overlook what is beneath the new stuff, and beneath are the basics.
So, if I am Java programmer with ten years of experience, and want to ask myself, how well do I know Java? The main part of the answer would not be how many java libraries or tools I've use during that course (half of what is obsolete or forgotten). But how well do I know Java language itself and its basic classes. Something that should be applied without using internet queries for usage.
And to know language well, we should test ourselves often against these basic things, and repeat it. Questions in this list are those we came upon during the time, or found on other web pages. We consider them basic, for java, or databases. If you think you are proficient at these areas, have a try at them, and feel free to comment how well you pass it!
Example int i = 1000; long j = i; //Implicit casting
int a=5,b=10; a=a+b; b=a-b; a=a-b; An other approach to the same question You use an XOR swap. for example: int a = 5; int b = 10; a = a ^ b; b = a ^ b; a = a ^ b;
for (String item : someList) { System.out.println(item); }code works?
for(Iteratori = someList.iterator(); i.hasNext(); ) { String item = i.next(); System.out.println(item); }
for(String s : myCollection.expensiveListGeneration()){ doSomething(); }how many times is expensiveListGeneration() invoked?
for (initialization; termination; increment) { statement(s) }The initialization expression initializes the loop; it's executed once, as the loop begins.
They are accessed through System.getProperties() and System.getProperty().New property can be added with -D jvm argument, or with System.setProperty().
class A{}; class B extends A {}; class C extends A {}; A a=new A(); B b=new B(); C c=new C(); a=b; //1 c=a; //2 b=(B)a; //3 b=(A)b; //4
class OC { int i =12; void ocm(){ int j =11; class IC{ void icm(){ System.out.println(i); System.out.println(j); } } } }
con.setAutoCommit(false);After the auto-commit mode is disabled, no SQL statements are committed until you call the method commit explicitly. All statements executed after the previous call to the method commit are included in the current transaction and committed together as a unit.
con.commit();
Map outParams = jdbcCall.execute(inParams);With JDBC:
cs = this.con.prepareCall("{call PROC_NAME()}"); ResultSet rs = cs.executeQuery();