---
title: "Data Types in Java ICSE Class 10: Casting and Scanner 2027"
description: "Data types in Java for ICSE Class 10: the primitive type table, implicit and explicit type casting with results, Scanner methods and the nextLine pitfall."
canonical: https://learn.modernagecoders.com/icse-class-10-data-types-and-input-java
source: src/pages/icse-class-10-data-types-and-input-java.html
---
> Data types in Java for ICSE Class 10: the primitive type table, implicit and explicit type casting with results, Scanner methods and the nextLine pitfall.

Start here

## Courses that teach types and input properly

Three routes: our ICSE Computer Applications batch, which drills types, casts and Scanner input every week; ISC-level Computer Science for the years after the board; and data structures for a student who wonders how values sit in memory.

[![ICSE Computer Applications Java with BlueJ course thumbnail](/images/java-teens.webp)  The batch / ICSE CA ICSE Computer Applications, Java with BlueJ Our small-group ICSE course, in which every result type is guessed on paper first and every input program is typed into BlueJ and run. Open the course →](/courses/icse-computer-applications-java-bluej-course)[![Computer Science Class 11 and 12 course thumbnail](/images/ip-cs-class-11-12.webp)  Next step / ISC Computer Science Class 11 and 12 Two more years of Java after Class 10, where a wrong type in a long program costs far more time to trace. Open the course →](/courses/cbse-icse-computer-science-class-11-12-python-java-complete-course)[![Data Structures and Algorithms course thumbnail](/images/dsa-college.webp)  Beyond the syllabus / DSA Data Structures and Algorithms Memory, arrays and how a choice between int and long changes what a program can handle. Open the course →](/courses/data-structures-algorithms-masterclass-college)

Ans. The short version

Java has eight primitive data types: byte, short, int and long for whole numbers, float and double for decimals, char for one character and boolean for true or false. String, arrays and objects are non-primitive types. In a mixed expression Java widens the smaller type itself (implicit conversion, or coercion); moving to a smaller type needs an explicit cast, so (int) 9.99 gives 9. ICSE input uses the Scanner class, where nextLine straight after nextInt returns an empty String. Our ICSE mini batch practises all of it on Tuesday and Wednesday evenings in India, with one to one classes for any other time.

Q1. What are the data types in Java?

## Values and data types ICSE: the eight primitive types

A data type tells Java what kind of value a variable holds, how much memory it uses and which operations are allowed. The ranges and default values below were printed by Java itself from each type's MIN_VALUE and MAX_VALUE constants and from unassigned fields.

| Type | Holds | Size | Range | Default | Literal |
| --- | --- | --- | --- | --- | --- |
| `byte` | Small whole number | 8 bits | -128 to 127 | 0 | None; `byte b = 12;` works |
| `short` | Whole number | 16 bits | -32768 to 32767 | 0 | None; `short s = 900;` works |
| `int` | Whole number | 32 bits | -2147483648 to 2147483647 | 0 | `425` |
| `long` | Large whole number | 64 bits | About ±9.22 x 1018 | 0 | `3000000000L` |
| `float` | Decimal, about 7 digits | 32 bits | Up to about 3.4 x 1038 | 0.0 | `2.75f` |
| `double` | Decimal, about 15 digits | 64 bits | Up to about 1.8 x 10308 | 0.0 | `2.75` |
| `char` | One Unicode character | 16 bits | Codes 0 to 65535 | Code 0 | `'k'` |
| `boolean` | true or false | Not fixed in bits by Java | true, false | false | `true` |

Default values apply to instance variables and array elements only. A local variable inside a method has no default, which is why using one before giving it a value does not compile. String, arrays and class objects are non-primitive (reference) types: their default is null.

### Literals and escape sequences

| Literal | Type | Escape sequence | Meaning |
| --- | --- | --- | --- |
| `64`, `-3` | int (integer literal) | `\n` | New line |
| `64L` | long | `\t` | Horizontal tab |
| `6.4`, `6.4e2` | double (real literal) | `\\` | One backslash |
| `6.4f` | float | `\"` | Double quote inside a String |
| `'6'` | char (character literal) | `\'` | Single quote |
| `"6"` | String (string literal) | Run: `System.out.println("A\tB\\C\"D\'E");` printed A, a tab, then B\C"D'E |
| `true`, `false` | boolean literals (the word null is the null literal) | An escape sequence counts as one character: `'\n'` is a single char |

Q2. What is implicit and explicit type casting in Java?

## Implicit and explicit type casting ICSE, worked to the result

Implicit conversion (coercion, or widening) is done by Java on its own when a smaller type meets a larger one. Explicit conversion (type casting, or narrowing) is written by the programmer as (type) value and may lose data. The widening order is byte, short, int, long, float, double, with char widening to int.

| # | Code | Result (run) | Kind and reason |
| --- | --- | --- | --- |
| 1 | `int a = 7; double x = 2.5;` `a + x` | 9.5 | Implicit: int widened to double |
| 2 | `char ch = 'A';` `ch + 3` | 68 | Implicit: char widened to int, code 65 plus 3 |
| 3 | `short s1 = 10, s2 = 20;` `int sum = s1 + s2;` | 30 | Implicit: short arithmetic is done in int |
| 4 | `byte p = 10, q = 20;` `byte r = p + q;` | Does not compile | javac: `possible lossy conversion from int to byte`; write `(byte) (p + q)` |
| 5 | `10 / 4 * 4.0` | 8.0 | 10 / 4 is int 2 first; only then widened for * 4.0 |
| 6 | `5 / 2.0f` | 2.5 | Implicit: int widened to float |
| 7 | `float ff = 1.1f;` `double dd = ff;` | 1.100000023841858 | Implicit widening keeps float's slightly inexact value |
| 8 | `(int) 9.99` and `(int) -9.99` | 9 and -9 | Explicit: the fraction is cut off, never rounded |
| 9 | `(int) 7.5` and `Math.round(7.5)` | 7 and 8 | A cast truncates; round rounds |
| 10 | `(char) 66` and `(int) 'z'` | B and 122 | Explicit: between a code and its character |
| 11 | `(byte) 200` | -56 | Explicit narrowing out of range wraps round: 200 minus 256 |
| 12 | `double avg = (double) (17 + 18) / 2;` | 17.5 | Explicit: the cast makes 35 a double before the division |
| 13 | `char cc = 'A' + 2;` | C | Allowed: a constant that fits in char needs no cast |
| 14 | `'a' + 'b'` and `"" + 'a' + 'b'` | 195 and ab | Two chars add as ints (97 + 98); a String first makes them join |
| 15 | `int big = 2147483647;` `big = big + 1;` | -2147483648 | Overflow: past the int maximum the value wraps to the minimum, with no error |
| 16 | `86400 * 1000 * 365` and `86400L * 1000 * 365` | 1471228928 and 31536000000 | Milliseconds in a year overflow int; one L makes the whole product long |

Writing `long n = 3000000000;` without the L does not even compile: javac says `integer number too large`, because a plain whole-number literal is an int. The return type of each Math method, which decides many of these results, is on [Math library methods for ICSE Class 10](/icse-class-10-math-library-methods), and how the operators combine types is on [operators in Java for ICSE Class 10](/icse-class-10-operators-in-java).

Q3. How do you take input in Java using the Scanner class?

## Scanner class input ICSE: every method and what it reads

Import java.util.Scanner (or java.util.*), create one object with new Scanner(System.in), print a prompt, then call the method that matches the type you want. Each next method skips leading spaces and reads one token; nextLine reads everything up to the end of the line.

| Method | Returns | Reads | If the input does not fit |
| --- | --- | --- | --- |
| `nextInt()` | int | One whole-number token | InputMismatchException |
| `nextLong()`, `nextShort()`, `nextByte()` | long, short, byte | One whole-number token in that type's range | InputMismatchException |
| `nextDouble()`, `nextFloat()` | double, float | One number token; 12 is read as 12.0 | InputMismatchException |
| `nextBoolean()` | boolean | The token true or false, in any case | InputMismatchException |
| `next()` | String | One word: stops at a space | Always works on text |
| `nextLine()` | String | The rest of the current line, spaces included | Returns "" if only the line end is left |
| `next().charAt(0)` | char | The first character of the next word | There is no nextChar() method |

***Six methods, one input**next against nextLine*

```
Scanner sc = new Scanner(System.in);
String first = sc.next();
String rest = sc.nextLine();
char grade = sc.next().charAt(0);
double fee = sc.nextDouble();
boolean paid = sc.nextBoolean();
long phone = sc.nextLong();

// Input line 1: Ananya Rao Kumar
// Input line 2: B+ 1250.75 true 9876543210
// first = [Ananya]  rest = [ Rao Kumar]
// grade = [B]  fee = [1250.75]
// paid = [true]  phone = [9876543210]
```

next stopped at the first space; nextLine took the rest, including its leading space. charAt(0) kept only B from the token B+. A ten-digit phone number needs nextLong, since it is beyond the int range.

| To read | Use |
| --- | --- |
| Marks, age, count | `nextInt()` |
| Price, percentage, radius | `nextDouble()` |
| Phone or account number | `nextLong()` |
| One word, such as a city | `next()` |
| A full name or sentence | `nextLine()` |
| A grade or menu letter | `next().charAt(0)` |

Values can also reach a program through initialisation in the code or as method parameters, which BlueJ asks for in a dialog box when the method is called. Converting a String that was read into a number uses the parse methods covered on [wrapper and library classes for ICSE Class 10](/icse-class-10-wrapper-and-library-classes).

Q4. Why does nextLine() skip input after nextInt()?

## The nextLine pitfall: why the text comes back empty, and the fix

nextInt reads the digits but leaves the Enter key, the line end, waiting in the input. The nextLine that follows finds that line end straight away and returns an empty String, so the program never waits for the text. Add one extra nextLine() call after nextInt to use up the leftover line end.

***Faulty**the name is skipped*

```
import java.util.Scanner;

public class Pitfall2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("Flat number: ");
        int flat = in.nextInt();
        System.out.print("Society: ");
        String society = in.nextLine();
        System.out.println(flat + ", " + society + ".");
    }
}
// Typed: 402, Enter, Green Meadows, Enter
// Printed: 402, .
```

The program printed the second prompt and finished at once: society is the empty String left over from the first line.

***Fixed**one extra line*

```
import java.util.Scanner;

public class Fixed2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("Flat number: ");
        int flat = in.nextInt();
        in.nextLine();
        System.out.print("Society: ");
        String society = in.nextLine();
        System.out.println(flat + ", " + society + ".");
    }
}
// Typed: 402, Enter, Green Meadows, Enter
// Printed: 402, Green Meadows.
```

The lone in.nextLine() reads and throws away the line end after 402, so the next call waits for the society name.

### A Section B input program that avoids the pitfall

***Name first, numbers after**marks, percentage and band*

```
import java.util.Scanner;

public class Report {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("Name: ");
        String name = sc.nextLine();
        System.out.print("Marks in 5 subjects: ");
        int total = 0;
        for (int k = 1; k <= 5; k++)
            total += sc.nextInt();
        double percent = total / 5.0;
        int rounded = (int) Math.round(percent);
        char band = percent >= 90 ? 'A' : percent >= 75 ? 'B' : 'C';
        System.out.println(name + ": total " + total + ", "
            + percent + "%, rounded " + rounded + ", band " + band);
    }
}
// Input: Ishaan Mehta / 88 92 79 95 82
// Ishaan Mehta: total 436, 87.2%, rounded 87, band B
```

Reading the full name before any number sidesteps the pitfall entirely. Two casts appear: 5.0 makes the percentage a double, and (int) turns the long from Math.round into an int.

| Variable | Type | Purpose |
| --- | --- | --- |
| `name` | String | Full name, read with nextLine |
| `total` | int | Sum of the five marks |
| `k` | int | Loop counter, 1 to 5 |
| `percent` | double | Average, with decimals kept |
| `rounded` | int | Percentage to the nearest whole number |
| `band` | char | A, B or C from the percentage |

A wrong token typed into nextInt stops the program with InputMismatchException; that and other crashes are classified on [ICSE Java error finding questions](/icse-class-10-java-error-finding-questions).

Q5. How are data types asked in Section A?

## Type conversion Java ICSE: the question shapes and how to answer

Section A is 40 compulsory marks of one-mark MCQs and two-mark parts, and this chapter supplies a steady share of both. The shapes repeat, so a fixed answer habit for each one is worth building.

### "Name the data type of"

Look at the literal itself: a decimal point means double unless it ends in f; single quotes mean char; double quotes mean String, even for one letter or a digit.

### "State the result type"

Find the largest type in the expression after char, byte and short have become int. That type is the answer, and the value must be written in it: 8.0, not 8.

### "Implicit or explicit?"

If you can see a (type) in brackets, it is explicit. If Java converts on its own because a smaller type met a bigger one, it is implicit, also called coercion or widening.

### "Primitive or non-primitive?"

The eight keywords in the table are primitive. String, arrays and classes are non-primitive, also called reference or composite types.

### "Write the statement to input"

Match the method to the type: a ten-digit number needs nextLong, a character needs next().charAt(0). Declare the variable in the same line.

### "Size in bytes"

Convert the bits: byte 1, short 2, int 4, long 8, float 4, double 8, char 2. Writing bits when bytes are asked is a common lost mark.

Mixed one-mark questions from every chapter are on [ICSE Computer Applications MCQ questions](/icse-computer-applications-mcq-questions), and the Class 9 chapters that this page revises are mapped on [Class 9 Java revision for Class 10](/icse-class-9-java-revision-for-class-10).

Q6. How are data types and input taught live?

## How the mini batch practises types, casts and input

Types are learnt by predicting a result type before running the code, and input is learnt by typing real values into real programs. The week is split that way.

1. #### Tuesday: predict the type, then the value

  At 5:30 PM IST the batch gets a timed set of mixed expressions and casts. Each answer is written as a type and a value, such as "double, 8.0".
2. #### BlueJ checks each one live

  Every expression is run on a shared screen. A missing .0 or a wrongly rounded cast is spotted by the whole group, not just the student who wrote it.
3. #### Wednesday: input programs

  At 8:00 PM IST students write a Section B program that reads mixed input with Scanner. The nextLine pitfall is triggered on purpose once, so nobody meets it for the first time in an exam.
4. #### Variable lists every time

  Each program ends with a variable list of name, type and purpose, the habit the ICSE paper asks for in its instructions.
5. #### Full papers from December

  Timed two-hour mock papers then mix type and input questions into both sections, and each script is marked the way an ICSE examiner would mark it.

Data types and input are the base for every program on [ICSE Class 10 Java programs for practice](/icse-class-10-java-programs-practice).

Batch or personalised: you choose

## Practise types and input in the mini batch, or one to one

What changes between the two formats is only the timing and the group. The type drills and input programs are identical. Families abroad are taught privately; families in India may choose. You pay month by month and there is no joining fee.

Option 1 · Fixed batch timings

### Mini batch, Tuesday 5:30 PM and Wednesday 8 PM

₹2,999

per month, two live classes a week

- Two fixed evenings: Tuesday 5:30 PM and Wednesday 8:00 PM IST
- Never more than six students in the group
- Timed result-type and casting sets each Tuesday
- A Scanner input program written each Wednesday
- Every cast and input run in BlueJ on screen

Book a free demo in this batch

Option 2 · Choose your own timing

### Personalised one to one

₹4,999

per month, one private class a week, at a time set with you

- Days and hours you choose, wherever you live
- Extra time on the conversions your child gets wrong
- Their own input programs debugged with them
- Class 9 gaps in this chapter filled first
- The teachers and 2027 syllabus of the batch, at your pace

Ask for a personalised plan

A student who joined ICSE Computer Applications late, or whose Class 9 basics are shaky, often needs a few one to one sessions on types and input before the rest of Class 10 makes sense. A student who is already comfortable and wants steady weekly practice across the paper is better served by the batch. Fees are shown in your own currency.

Studying outside India?

## Data types and input practice for ICSE students abroad

An ICSE school in the UAE or Singapore follows the same Computer Applications syllabus and paper, so the same type and input questions decide the same marks. Outside India the drills run one to one, after school in the student's own time zone.

| Where you live | Time difference | Usual class window, local time | Format |
| --- | --- | --- | --- |
| India (IST) every Indian city | IST | Tue 5:30 PM, Wed 8:00 PM | Mini batch or 1-on-1 |
| United Arab Emirates Dubai, Sharjah | 1 h 30 min behind India | 3:00 PM to 9:00 PM | Personalised 1-on-1 |
| Indonesia and Thailand West Java, Bangkok area | 1 h 30 min ahead of India | 3:30 PM to 9:00 PM | Personalised 1-on-1 |
| Singapore Singapore | 2 h 30 min ahead of India | 3:30 PM to 9:00 PM | Personalised 1-on-1 |

The slot is agreed after the free demo and can move around school tests. How overseas classes run is described on [ICSE Computer Applications classes in the Gulf and abroad](/icse-class-10-computer-applications-classes-gulf-and-abroad).

What families say

## Rated 4.9 across 547 Google reviews

Real reviews from real families. We neither write nor commission them.

★★★★★

"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."

Ria Mukherjee

Parent

★★★★★

"Modern Age Coders has been a game-changer for me. I struggled to grasp IT concepts and coding before joining, but their classes transformed everything. I can now confidently write complex programs with ease."

Samriddha Mondal

Student

★★★★★

"One of the most wonderful education centres out there. Education is not limited to school syllabus but focuses on skill development."

Vansh Agarwal

Student

★★★★★

"My child Dhairya is really enjoying the Modern Age Coders classes. This is his first online class and he eagerly looks forward to it. I can already see his improvement, and the teachers are very cooperative."

Sonam Oswal

Parent of Dhairya

★★★★★

"Modern Age Coders have wonderful teachers who teach in a clear, easy and practical way. The teacher boosts students' confidence and inspires them to learn without hesitation."

Sonu Goyal

Parent

★★★★★

"I highly recommend this computer coding class! The teachers are incredibly knowledgeable and passionate about coding."

Ritu Kedia

Parent

The rest of the Class 10 series

## More pages for Class 10 board students

Every page in the ICSE Class 10 Computer Applications series, grouped by what you need: classes, each chapter, Section B programs, question practice, notes and revision, and the exam itself.

### Classes, tuition and batches

- [The Tue and Wed ICSE Java batch](/icse-class-10-java-classes-online)
- [ICSE Java classes in the Gulf and abroad](/icse-class-10-computer-applications-classes-gulf-and-abroad)
- [ICSE BlueJ Java coaching](/icse-class-10-bluej-java-coaching)
- [ICSE computer crash course](/icse-computer-applications-crash-course)
- [ICSE computer tuition in Kolkata](/icse-computer-tuition-kolkata)
- [ICSE computer tuition in Bangalore](/icse-computer-tuition-bangalore)
- [ICSE computer tuition in Mumbai](/icse-computer-tuition-mumbai)
- [1-on-1 private Java tutor](/icse-computer-applications-private-tutor)
- [ICSE computer tuition in Lucknow](/icse-computer-tuition-lucknow)
- [ICSE computer tuition in Pune](/icse-computer-tuition-pune)
- [ICSE computer tuition near me](/icse-computer-tuition-near-me)
- [The mini batch, explained](/icse-computer-applications-small-batch-classes)

### Chapter by chapter

- [ICSE Computer Applications syllabus](/icse-class-10-computer-applications-syllabus-explained)
- [User-defined methods and overloading](/icse-class-10-user-defined-methods-overloading)
- [Constructors](/icse-class-10-constructors-questions)
- [Wrapper and library classes](/icse-class-10-wrapper-and-library-classes)
- [Class as the basis of all computation](/icse-class-10-class-as-basis-of-computation)
- [Encapsulation and access specifiers](/icse-class-10-encapsulation-access-specifiers)
- [Math library methods](/icse-class-10-math-library-methods)
- [Operators and expressions](/icse-class-10-operators-in-java)
- [Loops and loop conversion](/icse-class-10-loop-programs-java)
- [Class 9 Java revision for Class 10](/icse-class-9-java-revision-for-class-10)

### Programs for Section B

- [ICSE Java programs practice](/icse-class-10-java-programs-practice)
- [String programs](/icse-class-10-string-programs)
- [Special number programs](/icse-special-number-programs-java)
- [Sorting and searching programs](/icse-class-10-sorting-and-searching-programs)
- [2D array programs](/icse-class-10-2d-array-programs)
- [Pattern programs](/icse-class-10-pattern-programs-java)
- [Menu driven and switch case](/icse-class-10-menu-driven-programs)
- [Series programs](/icse-class-10-series-programs-java)
- [Slab and bill programs](/icse-class-10-slab-and-bill-programs)

### Questions and practice

- [ICSE CA important questions](/icse-class-10-computer-applications-important-questions)
- [Specimen paper and mock tests](/icse-class-10-computer-applications-specimen-paper-and-mock-tests)
- [Previous year papers, solved](/icse-computer-applications-previous-year-papers-solved)
- [Predict the output questions](/icse-class-10-java-output-questions)
- [Competency and case study questions](/icse-computer-applications-competency-questions)
- [MCQ for Question 1](/icse-computer-applications-mcq-questions)
- [Viva and oral questions](/icse-computer-applications-viva-questions)
- [Find the error questions](/icse-class-10-java-error-finding-questions)
- [Difference between questions](/icse-computer-difference-between-questions)

### Notes and revision

- [Chapter-wise notes](/icse-computer-applications-notes)
- [Textbook solutions guide](/icse-computer-applications-textbook-solutions-guide)
- [Worksheets with answers](/icse-computer-applications-worksheets)

### Exam, marks and internal assessment

- [ICSE board exam preparation](/icse-class-10-computer-applications-board-exam-preparation)
- [Exam date 2027 and paper pattern](/icse-class-10-computer-applications-exam-date-and-paper-pattern)
- [Project and internal assessment](/icse-class-10-computer-applications-project-and-internal-assessment)
- [How to score 100](/how-to-score-100-in-icse-computer-applications)
- [Paper analysis and answer key](/icse-computer-applications-paper-analysis)
- [Computer or Commercial Applications?](/icse-computer-applications-vs-commercial-applications)

**CBSE Class 10 AI (417):** [The Mon and Wed 9 PM AI batch](/cbse-class-10-ai-classes-online)  [CBSE AI 417 syllabus explained](/cbse-class-10-ai-syllabus-explained)  [CBSE AI important questions](/cbse-class-10-ai-important-questions)  [Sample paper and mock tests](/cbse-class-10-ai-sample-paper-and-mock-tests)

Questions about data types and input

## What students ask about data types and Scanner input in ICSE Java

### How many data types are there in Java?

Java has eight primitive data types: byte, short, int, long, float, double, char and boolean. Besides these there are non-primitive, or reference, types such as String, arrays and classes, which hold a reference to an object rather than the value itself. ICSE expects the eight primitive types with their sizes.

### What is the difference between primitive and non-primitive data types?

Primitive types are built into Java, store the value directly and have a fixed size, such as int at 32 bits. Non-primitive types, such as String, arrays and class types, are created from classes, store a reference to an object, can be null, and can have methods called on them.

### What is implicit type conversion in Java?

Implicit conversion, also called coercion or widening, is the automatic change of a smaller type into a larger one when they meet in an expression or assignment. For example, an int added to a double is converted to double first, so 7 + 2.5 gives 9.5. No data is lost, so Java does it without being asked.

### What is explicit type casting in Java with an example?

Explicit casting is a conversion the programmer writes by putting the target type in brackets before a value. (int) 9.99 gives 9, because the fraction is cut off, and (char) 66 gives B. It is needed whenever a value moves to a smaller type, such as double to int, since data may be lost.

### What is the size of char in Java?

char is 16 bits, which is 2 bytes, because Java stores characters in Unicode. It holds codes from 0 to 65535. This differs from languages that use 1 byte for a character, and ICSE questions sometimes test exactly that difference.

### Which Scanner method is used to input a character in Java?

Scanner has no nextChar method. The usual way is sc.next().charAt(0), which reads the next word as a String and keeps its first character. If the user types more than one character, only the first is kept, so B+ would give B.

### What is the difference between next() and nextLine()?

next() reads one word: it skips leading spaces and stops at the next space or line end. nextLine() reads the whole rest of the current line, spaces included, and then moves past the line end. Use next() for one word such as a city and nextLine() for a full name or a sentence.

### Why is nextLine() skipped after nextInt()?

nextInt() reads the number but leaves the line end from the Enter key in the input. The next nextLine() reads up to that line end at once and returns an empty String, so it looks as if the input was skipped. Call sc.nextLine() once more after nextInt() to use up the leftover line end.

### What is the default value of a variable in Java?

Instance variables and array elements get defaults: 0 for whole-number types, 0.0 for float and double, the character with code 0 for char, false for boolean and null for String and other references. Local variables inside a method get no default and must be assigned before use, or the program will not compile.

### Do you teach data types and Scanner input in the live ICSE classes?

Yes. The mini batch drills result types and casts in timed sets every Tuesday at 5:30 PM IST and writes a Scanner input program every Wednesday at 8:00 PM IST, with every answer run in BlueJ on a shared screen. Students who need gaps filled from Class 9 can take personalised one to one classes.

Start

## Book a free live class on data types and input

In the free demo your child predicts the type and value of a few mixed expressions and casts, writes a short Scanner program with the mentor, and watches both run in BlueJ, including the nextLine pitfall and its fix. Afterwards you hear plainly which basics need work and whether the mini batch or one to one suits your child better.

Want more first? See [operators in Java for ICSE Class 10](/icse-class-10-operators-in-java) or [the ICSE Class 10 Java classes](/icse-class-10-java-classes-online).

[WhatsApp us](https://wa.me/919123366161?text=Hello%20Modern%20Age%20Coders.%20I%20want%20live%20practice%20of%20data%20types%2C%20type%20casting%20and%20Scanner%20input%20for%20ICSE%20Class%2010.) · [+91 91233 66161](tel:+919123366161) · [connect@modernagecoders.com](mailto:connect@modernagecoders.com)

Every class is live video. The form requests a callback and reserves nothing.

### Want it sooner? Book a priority demo

A full live class of about 45 to 60 minutes at a slot you pick, with a written skill report and learning roadmap on WhatsApp afterwards. The fee is adjusted against your first month if you enrol.

[Book a priority demo](/book-demo)

## Keep exploring Modern Age Coders

### By class and age

- [Employability Skills Class 10 MCQ: 45 with Answers (417)](/employability-skills-class-10-mcq)
- [Confusion Matrix Class 10 AI: 12 Numericals with Solutions](/confusion-matrix-class-10-ai-numericals)
- [Computer Science Class 12 ICSE: ISC Java Data Structures](/computer-science-class-12-icse)
- [Computer Science Class 12 CBSE: Python Data Structures](/computer-science-class-12-cbse)
- [Computer Science Class 11 ICSE: Java OOP](/computer-science-class-11-icse)
- [Computer Science Class 11 CBSE: Python](/computer-science-class-11-cbse)
- [ICSE Computer Applications Competency Based Questions](/icse-computer-applications-competency-questions)
- [Coding for Class 7: Python, JavaScript](/coding-for-class-7)
- [Python for Class 8: OOP, Flask API, sklearn, Kaggle Datasets & DSA Intro](/python-for-class-8)

### Learn more

- [Java Classes for Teens](/java-classes-for-teens)
- [Java for Teens: Complete Course from Beginner to Advanced](/courses/java-programming-masterclass-for-teens)
- [Java Classes for Teens in Canada: ICS3U, ICS4U and Beyond](/java-classes-for-teens-in-canada)
- [Java Programming for Kids & Teens: Learn Java Online](/java-programming-for-kids-teens)

### Free resources

- [Java Tutorial for Beginners to Advanced](/resources/java)
- [Inheritance in Java](/resources/java/inheritance-in-java)
- [Lambda Expressions and Streams API](/resources/java/lambda-expressions-and-streams)
- [Multithreading Basics](/resources/java/multithreading-basics)

### From the blog

- [Java Tutorials & Programs](/blog/topic/java)
- [Java Constructors Explained: Types, Overloading, ICSE](/blog/java-constructors-explained)
- [String Handling in Java: The ICSE and CBSE Guide](/blog/string-handling-in-java)
- [50 Important Java Programs for ICSE Class 10 Boards](/blog/50-java-programs-for-icse-class-10)

### Start here

- [Book a free demo class with Modern Age Coders](/book-demo)
- [Real projects built by Modern Age Coders students](/student-labs)

---

*Canonical: https://learn.modernagecoders.com/icse-class-10-data-types-and-input-java*
