Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

please elaborate this ?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in Boyarsky Selikoff-Oracle Certified Associate Java SE 8 Programmer I Study Guide Exam 1Z0-808-2014
page no.11


it is written like why it is written like The answer is that three of the imports are redundant. Lines 1 and 2 are redundant because everything in java.lang is automatically considered to be imported.
at least one out of this two line will be needed right to import it
please reply as soon as possible
Regards
SNAG-0000.jpg
[Thumbnail for SNAG-0000.jpg]
page picture
 
Bartender
Posts: 3530
150
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But what is your question? Don't you agree with the given answer?

Rishit Shah wrote:at least one out of this two line will be needed right to import it


If you mean the lines 3 and 4, then it is exactly one of these lines (not 'at least') that is needed.
 
Marshal
Posts: 65851
250
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for providing the full details of the question . We only use words like “urgent”, “as soon as possible”, or similar on 1st April
What that bit of code is probably intended to show is that multiple imports are permissible. Tell me what will happen if you try to compile and run the following code, which is quite similar to what you posted:-Also tell me: if you actually persuade that code to run many times, how often will it print “10”?
 
Rishit Shah
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok  I got it
in Java System.lang is not necessary  to import as it automatically get imported
thank you for you kind reply
i am in java and also in coderanch to so dont know much function and option thank you guys
 
Campbell Ritchie
Marshal
Posts: 65851
250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and what happened when you tried to compile my version of that code? How often do you expect it to print “10”?
 
This will take every ounce of my mental strength! All for a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!