Tech Students World
Subscribe
Subscribe to get the update Newsletters. This site is updated daily. Don't miss to check what's added.
                 Technology of the Week: iPod Basics *  Help of the Week: Blu-ray Technology
Skip Navigation Links
ContactUs
StudentsLibraryExpand StudentsLibrary
ExplanationOfTechnologiesExpand ExplanationOfTechnologies
TechEducationExpand TechEducation
TechTipsExpand TechTips
UsefulStudent ResourcesExpand UsefulStudent Resources
TodaySpecialsExpand TodaySpecials
WeekSpecialsExpand WeekSpecials
                                                    
Free Downloads Skip Navigation LinksHome > Java Certification Questions-Notes > Fundamental Classes in Java
Skip Navigation Links
Home
Buying ComputersExpand Buying Computers
CertificationsExpand Certifications
Computer BasicsExpand Computer Basics
Computer DevicesExpand Computer Devices
Computer MaintenanceExpand Computer Maintenance
Computer SettingsExpand Computer Settings
Operating SystemsExpand Operating Systems
ProcessorsExpand Processors
Using MS-WindowsExpand Using MS-Windows
Internet BasicsExpand Internet Basics
Internet ServicesExpand Internet Services
Software AttacksExpand Software Attacks
Useful Links
New Student Resources
. Student Employment
. Cover Letter
. Applying for Graduate Assistantships
. SCJP Preparation
. Applying for US Universities

Fundamental Classes in Java

                                        
Note: Here,
SOP = System.out.println("");
psvm()=public static void main(String args[])

No. Java Question Answer/Output Explanation
1 SOP(~Integer.MAX_VALUE
== Integer.MIN_VALUE);
True -
2 SOP(Math.min(-0f,0f)); -0.0 -
3 SOP(Math.min(-0f, 0f)= =0f); True -
4 SOP(Math.round(Long.MAX_VALUE + 1.5)
= = Long. MAX_VALUE);
True -
5 SOP(Math.round(Integer.MIN_VALUE - 6.5f)
= = Integer.MIN_VALUE);
True -
6 Math.round (Integer.MIN_VALUE -6.5)
= = Integer.MIN_VALUE);
False -
7 SOP(Math.min(-0.0,+0.0)); -0.0 -
8 SOP(Math.max (-0.0, +0.0)); +0.0
9 SOP( Math.min(-0.0, +0.0)
= = Math.max (0.0, +0.0)));
True The oder of floating or the double values is Infinity->Negative Numbers/Fractions->-0.0->+0.0->positive numbers/Fractions->Infinity
10 double d = -0.5;
SOP(Math.Ceil (d));
-0.0 -
11 SOP(-1 * Double.NEGATIVE
_INFINITY);
Infinity -
12 SOP(1 * Double.NEGATIVE
_INFINITY);
-Infinity -
13 SOP(int a = Integer.MAX_VALUE + 1); -2147483648 -
14 SOP(int a = Integer.MIN_VALUE - 1); 2147483648 -
15 SOP(Math.abs(Integer.MIN_VALUE)); -2147483648 This is the Integer.MIN
_VALUE
16 SOP(Math.min(0.0,-0.0); -0.0 -
17 SOP(Math.round(Float.MAX_VALUE)); Integer.MAX_VALUE -
18 Integer i = new Integer("10");
i.toString() = = i.toString();
True Only upto 0 to 10 remaining all results false for both Integers, Bytes. The toString() method returns String equivalent of this String object. It creates a new object each time it is called. The = = operator compares the bit patterns of the two object references and not the actual String contents.
19 SOP(Math.abs(Float.MIN_
VALUE) > 0);
True -
20 SOP(Math.abs(Double.MIN
_VALUE) > 0);
True -
21 SOP(Math.abs(Integeer.MIN_
VALUE) > 0);
False -
22 SOP(Math.abs(Long.MIN_
VALUE) > 0);
False -
23 Integer i = new Integer(21);
Integer j = new Integer(10);
SOP(i+j);
Compile
Time Error
+ cannot be applied to Integer
24 Integer i = new Integer(21);
Integer j = new Integer(10);
SOP((i+j).toString());
Compile
Time Error
-
25 Integer i = new Integer(21);
Integer j = new Integer(10);
SOP(""+i+j);
2310 -
26 Integer i = new Integer(21);
Integer j = new Integer(10);
SOP(i+""+j);
2310 -
27 Integer i = new Integer(21);
Integer j = new Integer(10);
SOP(i.toString()+j.toString());
2310 -
28 SOP(Math.min(Float.NaN, Float.POSITIVE_INFINITY)); NaN -
29 SOP(Math.min(Float.NaN,0.0); NaN -
30 SOP(Math.max(Float.NaN, Float.POSITIVE_INFINITY)); NaN -
31 SOP(Math.min(Float.NaN,Float.NEGATIVE_
INFINITY));
NaN -
32 SOP(Math.max(Float.NaN,0.0)); NaN -
33 SOP(Math.max(Float.NaN,Float.NEGATIVE_
INFINITY));
NaN -
34 SOP(Math.max(Float.POSITIVE_INFINITY,
Double.POSITIVE_INFINITY));
Infinity -
35 SOP(Float.POSITIVE_INFINITY = = Double.POSITIVE_INFINITY); True -
36 SOP(Float.NEGATIVE_INFINITY= = Double.NEGATIVE_INFINITY) True -
Skip Navigation Links.     
What's New
. Blu-ray
. iPod Basics
. Doing Java Project
. Symmetric MP
. Digital Cameras
. Virus,Spyware
. Sound to WebPage
. Wi-Fi
Popular Articles
. UNIX Commands
. Software Attacks
.
Adding RAM
. US Universities
. Free Java Tutorial
. Student Jobs
. Learn Spanish
. Java Notes
Let The World Know How Knowledgeable You Are
By sharing Your Knowledge With Others
If you would like to share your knowledge relating to Technology, you can send it to us at dailyquestion@techstudentsworld.com. If it is good, it will be published in this site along with your name or picture.
                  Copyright © 2008, Techstudentsworld.com. All Rights Reserved.