R Karthik

+ Follow
since Feb 09, 2018
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by R Karthik

Thanks for your quick response.

Double d=Double.valueOf(120D);    //1  Compiles Successfully)

Float f=Float.valueOf(120D);       //2
Long a=Long.valueOf(120D);                       //3
Integer b=Integer.valueOf(120D);
     //4             // But not 2,3&4.

Could someone explain to me, clearly?
Why 2,3 & 4 are giving a compilation error but 1 doesn't?
Thanks for your help, in advance.
Thanks for your reply.
Please see the below questions,
         class MyString extends String{   
                { super(); }}

Answer: You cannot extend string class because it's a final class. I am sure, the book never discussed that String is a final class anywhere.

2)Identify the correct statements,

So many options were listed but this is the correct answer.
Local date, Local Time and LocalDateTime implement TemporalAccessor.

Again, same. I have never seen any info regarding TemporalAccessor.

3)Which of the following are true regarding the new Date-Time API of Java 8?

Answer: It uses the calendar system defined in ISO-8601 as the default calendar.

and there are some more questions as well.

Could someone explain me this question clearly for me, Thanks.

for(int i=0;i<5;i++){
if(i<2) continue;
else break;

OCA Sybex book, page number,91 says(Table 2.5), that if statement won't allow continue statement.
But the above code compiles without any issue.

I did see some examples in the book with If statement having continue, but with optional labels. so I understood that if statement allows "continue",  only when the optional labels were used.
But I am confused now, could someone explain to me clearly, where I am going wrong.
I have got the OCA SE 8 Programmer 1 book and bought the Enthuware kit as well to practise side by side.
I only took the standard test and felt most of the questions were not covered in my book.
Am I the only person having this issues, or do you guys felt the same.
Please let me know, what are the other books, I can get?
Thanks in advance
Thanks for your reply.
Yes, I am using an electronic version. (Kindle)
Chapter 5 Review questions.
Question No 19) Where is the blank in the question?

public class Snake {}
public class Cobra extends Snake {}
public class GardenSnake {}
public class SnakeHandler {
   private Snake snake;
   public void setSnake(Snake snake) { this.snake = snake; }
public static void main(String[] args) {
     new SnakeHandler().setSnake();

Please reply, thanks