Check Point Software Most Frequently Asked Latest Core Java Interview Questions Answers
What Is Downcasting ?
Downcasting is the casting from a general to a more specific type, i.e. casting down the hierarchy.
What Modifiers May Be Used With An Inner Class That Is A Member Of An Outer Class?
A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.
How Many Bits Are Used To Represent Unicode, Ascii, Utf-16, And Utf-8 Characters?
Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns.
What Restrictions Are Placed On The Location Of A Package Statement Within A Source Code File?
A package statement must appear as the first line in a source code file (excluding blank lines and comments).
What Is A Native Method?
A native method is a method that is implemented in a language other than Java.
What Are Order Of Precedence And Associativity, And How Are They Used?
Order of precedence determines the order in which operators are evaluated in expressions. Associatity determines whether an expression is evaluated left-to-right or right-to-left.
Can An Anonymous Class Be Declared As Implementing An Interface And Extending A Class?
An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.
What Is The Range Of The Char Type?
The range of the char type is 0 to 2^16 - 1.
What Is The Range Of The Short Type?
The range of the short type is -(2^15) to 2^15 - 1.
Why Isn't There Operator Overloading?
Because C++ has proven by example that operator overloading makes code almost impossible to maintain.
What Does It Mean That A Method Or Field Is "static"?
Static variables and methods are instantiated only once per class. In other words they are class variables, not instance variables. If you change the value of a static variable in a particular object, the value of that variable changes for all instances of that class. Static methods can be referenced with the name of the class rather than the name of a particular object of the class (though that works too). That's how library methods like System. out. println() work. out is a static field in the java.lang.System class.
Is Null A Keyword?
The null value is not a keyword.
Which Characters May Be Used As The Second Character Of An Identifier,but Not As The First Character Of An Identifier?
The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier.
Is The Ternary Operator Written X : Y ? Z Or X ? Y : Z ?
It is written x ? y : z.
How Is Rounding Performed Under Integer Division?
The fractional part of the result is truncated. This is known as rounding toward zero.
If A Class Is Declared Without Any Access Modifiers, Where May The Class Be Accessed?
A class that is declared without any access modifiers is said to have package access. This means that the class can only be accessed by other classes and interfaces that are defined within the same package.
Does A Class Inherit The Constructors Of Its Superclass?
A class does not inherit constructors from any of its superclasses.
Name The Eight Primitive Java Types.
The eight primitive types are byte, char, short, int, long, float, double, and boolean.
What Restrictions Are Placed On The Values Of Each Case Of A Switch Statement?
During compilation, the values of each case of a switch statement must evaluate to a value that can be promoted to an int value.
What Is The Difference Between A While Statement And A Do Statement?
A while statement checks at the beginning of a loop to see whether the next loop iteration should occur. A do statement checks at the end of a loop to see whether the next iteration of a loop should occur. The do statement will always execute the body of a loop at least once.
What Modifiers Can Be Used With A Local Inner Class?
A local inner class may be final or abstract.
When Does The Compiler Supply A Default Constructor For A Class?
The compiler supplies a default constructor for a class if no other constructors are provided.
If A Method Is Declared As Protected, Where May The Method Be Accessed?
A protected method may only be accessed by classes or interfaces of the same package or by subclasses of the class in which it is declared.
What Are The Legal Operands Of The Instanceof Operator?
The left operand is an object reference or null value and the right operand is a class, interface, or array type.
Are True And False Keywords?
The values true and false are not keywords.
What Happens When You Add A Double Value To A String?
The result is a String object.
What Is The Diffrence Between Inner Class And Nested Class?
When a class is defined within a scope od another class, then it becomes inner class. If the access modifier of the inner class is static, then it becomes nested class.
Can An Abstract Class Be Final?
An abstract class may not be declared as final.
What Is Numeric Promotion?
Numeric promotion is the conversion of a smaller numeric type to a larger numeric type, so that integer and floating-point operations may take place. In numerical promotion, byte, char, and short values are converted to int values. The int values are also converted to long values, if necessary. The long and float values are converted to double values, as required.
What Is The Difference Between A Public And A Non-public Class?
A public class may be accessed outside of its package. A non-public class may not be accessed outside of its package.
To What Value Is A Variable Of The Boolean Type Automatically Initialized?
The default value of the boolean type is false
What Is Downcasting ?
Downcasting is the casting from a general to a more specific type, i.e. casting down the hierarchy.
What Modifiers May Be Used With An Inner Class That Is A Member Of An Outer Class?
A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.
How Many Bits Are Used To Represent Unicode, Ascii, Utf-16, And Utf-8 Characters?
Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns.
What Restrictions Are Placed On The Location Of A Package Statement Within A Source Code File?
A package statement must appear as the first line in a source code file (excluding blank lines and comments).
What Is A Native Method?
A native method is a method that is implemented in a language other than Java.
Check Point Software Most Frequently Asked Latest Core Java Interview Questions Answers |
What Are Order Of Precedence And Associativity, And How Are They Used?
Order of precedence determines the order in which operators are evaluated in expressions. Associatity determines whether an expression is evaluated left-to-right or right-to-left.
Can An Anonymous Class Be Declared As Implementing An Interface And Extending A Class?
An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.
What Is The Range Of The Char Type?
The range of the char type is 0 to 2^16 - 1.
What Is The Range Of The Short Type?
The range of the short type is -(2^15) to 2^15 - 1.
Why Isn't There Operator Overloading?
Because C++ has proven by example that operator overloading makes code almost impossible to maintain.
What Does It Mean That A Method Or Field Is "static"?
Static variables and methods are instantiated only once per class. In other words they are class variables, not instance variables. If you change the value of a static variable in a particular object, the value of that variable changes for all instances of that class. Static methods can be referenced with the name of the class rather than the name of a particular object of the class (though that works too). That's how library methods like System. out. println() work. out is a static field in the java.lang.System class.
Is Null A Keyword?
The null value is not a keyword.
Which Characters May Be Used As The Second Character Of An Identifier,but Not As The First Character Of An Identifier?
The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier.
Is The Ternary Operator Written X : Y ? Z Or X ? Y : Z ?
It is written x ? y : z.
How Is Rounding Performed Under Integer Division?
The fractional part of the result is truncated. This is known as rounding toward zero.
If A Class Is Declared Without Any Access Modifiers, Where May The Class Be Accessed?
A class that is declared without any access modifiers is said to have package access. This means that the class can only be accessed by other classes and interfaces that are defined within the same package.
Does A Class Inherit The Constructors Of Its Superclass?
A class does not inherit constructors from any of its superclasses.
Name The Eight Primitive Java Types.
The eight primitive types are byte, char, short, int, long, float, double, and boolean.
What Restrictions Are Placed On The Values Of Each Case Of A Switch Statement?
During compilation, the values of each case of a switch statement must evaluate to a value that can be promoted to an int value.
What Is The Difference Between A While Statement And A Do Statement?
A while statement checks at the beginning of a loop to see whether the next loop iteration should occur. A do statement checks at the end of a loop to see whether the next iteration of a loop should occur. The do statement will always execute the body of a loop at least once.
What Modifiers Can Be Used With A Local Inner Class?
A local inner class may be final or abstract.
When Does The Compiler Supply A Default Constructor For A Class?
The compiler supplies a default constructor for a class if no other constructors are provided.
If A Method Is Declared As Protected, Where May The Method Be Accessed?
A protected method may only be accessed by classes or interfaces of the same package or by subclasses of the class in which it is declared.
What Are The Legal Operands Of The Instanceof Operator?
The left operand is an object reference or null value and the right operand is a class, interface, or array type.
Are True And False Keywords?
The values true and false are not keywords.
What Happens When You Add A Double Value To A String?
The result is a String object.
What Is The Diffrence Between Inner Class And Nested Class?
When a class is defined within a scope od another class, then it becomes inner class. If the access modifier of the inner class is static, then it becomes nested class.
Can An Abstract Class Be Final?
An abstract class may not be declared as final.
What Is Numeric Promotion?
Numeric promotion is the conversion of a smaller numeric type to a larger numeric type, so that integer and floating-point operations may take place. In numerical promotion, byte, char, and short values are converted to int values. The int values are also converted to long values, if necessary. The long and float values are converted to double values, as required.
What Is The Difference Between A Public And A Non-public Class?
A public class may be accessed outside of its package. A non-public class may not be accessed outside of its package.
To What Value Is A Variable Of The Boolean Type Automatically Initialized?
The default value of the boolean type is false
Post a Comment