Posts

Showing posts from June, 2026

📢 Join My WhatsApp Channel JavaWithSumit

Get Daily ICSE Java Notes, Programs & Exam Tips 🚀

👉 Join Now

ICSE Java Programs Part-I | Basic Input Output & Conditional Programs with Solutions

Input/ Output Based Programs Question 1: WAP in Java to accept different type of data as input from Scanner class and print. Solution:  import java.util.Scanner; class DifferentDataTypes { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.print("Enter an Integer: "); int i = sc.nextInt(); System.out.print("Enter a Float: "); float f = sc.nextFloat(); System.out.print("Enter a Double: "); double d = sc.nextDouble(); System.out.print("Enter a Long: "); long l = sc.nextLong(); System.out.print("Enter a Byte: "); byte b = sc.nextByte(); System.out.print("Enter a Short: "); short s = sc.nextShort(); System.out.print("Enter a Character: "); char ch = sc.next().charAt(0); sc.nextLine(); // Clear buffer System.out.print("En...