Section 1

Preview this deck

What is reference data type and what are they

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

4 years ago

Date created

Mar 1, 2020

Cards (8)

Section 1

(8 cards)

What is reference data type and what are they

Front

A reference type is a data type that refers to an object in memory. In Java there are three reference data types - Array, Class, Interface

Back

Implicit - widening - from smaller to bigger

Front

Widening Casting(Implicit) From a byte to a short, an int, a long, a float, or a double From a short to an int, a long, a float, or a double From a char to an int, a long, a float, or a double From an int to a long, a float, or a double From a long to a float or a double From a float to a double

Back

Difference between Primitive Data Type and Wrapper class?

Front

An instance of a primitive class holds the actual value of the instance, but instance of a wrapper class holds a reference to the object.

Back

What is the difference between "Upcasting" and "Downcasting"

Front

Up-casting is casting to a supertype, while downcasting is casting to a subtype. Supercasting is always allowed, but subcasting involves a type check.

Back

Explicit - narrowing - from bigger to smaller

Front

Narrowing Casting(Explicitly done) From a byte to a char From a short to a byte or a char From a char to a byte or a short From an int to a byte, a short, or a char From a long to a byte, a short, a char, or an int From a float to a byte, a short, a char, an int, or a long From a double to a byte, a short, a char, an int, a long, or a float

Back

Type Casting

Front

Assigning a value of one type to a variable of another type is known as Type Casting, taking an Object of one particular type and "turning it into" another Object type. Casting is a very useful mechanism that allows you to write more generic code that will allow you to handle many coding situations.

Back

Wrapper Classes

Front

Wrapping is converting primitive data types into objects. Wrapping classes encapsulate, or wrap, the primitive types within a class: byte - Byte; short - Short int - Integer long - Long float - Float double - Double char - Character boolean - Boolean This also called Auto Boxing - Automatic conversion of primitive types to the object of their corresponding wrapper classes.

Back

New Features of JAVA 8

Front

Enhanced Productivity by providing Optional Classes feature, Lamda Expressions, Streams etc. Ease of Use Improved Polyglot programming. A ploygot is a program or script, written in a form which is valid in multiple programming languages and it performs the same operations in multiple programming languages. So Java now supports such type of programming technique. Improved Security and performance.

Back