Define a class to declare an array to accept and store ten words. Display only those words which begin with the letter 'A' or 'a' and also end with the letter 'A' or 'a'.
Sunday, July 9, 2023
Define a class to declare an array to accept and store ten words. Display only those words which begin with the letter 'A' or 'a' and also end with the letter 'A' or 'a'.
Define a class to accept a string, and print the characters with the uppercase and lowercase reversed, but all the other characters should remain the same as before
Define a class to accept a string, and print the characters with the uppercase and lowercase reversed, but all the other characters should remain the same as before.
Saturday, July 8, 2023
Define a class to accept a string and print number of digits, alphabets and special characters in the string.
Saturday, November 27, 2021
Java MCQs Part-01 | By LearnWithVishalGiri | ICSE Computer Application
Saturday, July 17, 2021
Methods in Java
What is method?
What is the advantages of using methods?
What is method prototype?
What is method signature?
What is formal parameter?
What is actual parameter?
Code 01
- import java.util.Scanner;
- public class ParkingLot
- {
- int vno;
- int hours;
- double bill;
- public static void main(String args[])
- {
- ParkingLot ob = new ParkingLot();
- ob.input();
- ob.calculate();
- ob.display();
- }
- void input()
- {
- Scanner sc = new Scanner(System.in);
- System.out.print("Enter the vehicle number: ");
- vno = sc.nextInt();
- System.out.print("Enter the hours vehicle is parked: ");
- hours = sc.nextInt();
- }
- void calculate()
- {
- if(hours<=1)
- bill = 3;
- else
- bill = 3+(hours-1)*1.5;
- }
- void display()
- {
- System.out.println("Vehicle Number = "+vno);
- System.out.println("Hours Parked = "+hours);
- System.out.println("Bill Amount = "+bill);
- }
- }
- import java.util.Scanner;
- public class FunctionOverload
- {
- void compare(int a,int b)
- {
- if(a>b)
- System.out.println(a+" is greater.");
- else if(a<b)
- System.out.println(b+" is greater.");
- else
- System.out.println("Both are equal.");
- }
- void compare(char a,char b)
- {
- if((int)a>(int)b)
- System.out.println(a+" is greater.");
- else if((int)a<(int)b)
- System.out.println(b+" is greater.");
- else
- System.out.println("Both are equal.");
- }
- void compare(String a,String b)
- {
- int l1 = a.length();//6
- int l2 = b.length();//7
- if(l1>l2)
- System.out.println(a+" is greater in length");
- else if(l1<l2)
- System.out.println(b+" is greater in length");
- else
- System.out.println("Both are equal");
- }
- public static void main(String args[])
- {
- FunctionOverload ob = new FunctionOverload();
- Scanner sc = new Scanner(System.in);
- int p,q;
- p = sc.nextInt();
- q = sc.nextInt();
- ob.compare(p,q);
- char ch1,ch2;
- ch1 = sc.next().charAt(0);
- ch2 = sc.next().charAt(0);
- ob.compare(ch1,ch2);
- String s1,s2;
- s1 = sc.next();
- s2 = sc.next();
- ob.compare(s1,s2);
- }
- }
Saturday, February 13, 2021
Previous Year Questions on Strings
ICSE Class 10 Computer Applications
Previous Year Questions on String
Tuesday, February 2, 2021
Java Language Fundamentals
Hi All,
Here we all will be discussing about some fundamental concepts of Java.
1. Identifiers
Identifiers can be defined as a name in java program which can be used for identification purpose. It can be a method name, variable name, class name, label name, package name or interface name.
For example:
For example:
1. Identifiers can have alphabets (a-z, A-Z), digits(0-9), underscore(_) and dollar sign($).
2. Identifiers can be of any length.
3. Identifiers must not begin with digits.
4. Identifiers are case sensitive i.e. uppercase and lowercase letters are treated differently.
5. We cannot use reserved words as identifiers.
6. All predefined classes and interfaces can be use as identifiers name. Even though it is valid but it is not a good programming practice.
Reserved Words:
Java has 53 reserved words.
Check whether the word is Special word or Palindrome word.
Special words are those words which starts and ends with the same letter. Examples: EXISTENCE COMIC WINDOW Palindrome words are those words...





