• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

More questions

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks everybody for the help on the previous question.
I have my exam on 30/4 and have few doubts:
1) class Tes {
public static void main(String args[]) {
for(int i=0; i < 2; i++) {
continue;
System.out.println("Hello World");
}
}
}
why does it give compiler error?

2) public class Test {
public static void main(String args[])
{
Float f = new Float(32D);
System.out.println(f);
}
}
Why is the Output 32.0 ?My understanding is that a Float wrapper class can take a float assignment value. Then why does passing a double value does not give error?
3) Does Object class implement Cloneable interface?
4) A non-static inner class is accessible from any other class(T/F)?
5) Is << a signed shift operator?
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Because you can never get to the println, the continue causes you to break out of that iteration.
2. It fit.
3. Read the API (no).
4. Only via an instance of the outer class.
5. No. From the JLS:


The shift operators include left shift <<, signed right shift >>, and unsigned right shift >>>;

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic