afaq

Java String Function equals()

The java string equals() method compares the two given strings based on the content of the string. If any character is not matched, it returns false. If all characters are matched, it returns true. The String equals() method overrides the equals() method of Object class. Java String equals() method example public class EqualsExample{ public static […]

Java String function contains()

The java string contains() method searches the sequence of characters in this string. It returns true if sequence of char values are found in this string otherwise returns false. Java String contains() method example class ContainsExample{ public static void main(String args[]){ String name=”what do you know about me”; System.out.println(name.contains(“do you know”)); System.out.println(name.contains(“about”)); System.out.println(name.contains(“hello”)); }} Output: […]

Java String Function concat

The java string concat() method combines specified string at the end of this string. It returns combined string. It is like appending another string. Java String concat() method example public class ConcatExample{ public static void main(String args[]){ String s1=”java string”; s1.concat(“is immutable”); System.out.println(s1); s1=s1.concat(” is immutable so assign it explicitly”); System.out.println(s1); }} Output: java string […]

Java String Function compareTo()

The java string compareTo() method compares the given string with current string lexicographically. It returns positive number, negative number or 0. It compares strings on the basis of Unicode value of each character in the strings. If first string is lexicographically greater than second string, it returns positive number (difference of character value). If first […]

Java String Function charAt()

The java string charAt() method returns a char value at the given index number. The index number starts from 0 and goes to n-1, where n is length of the string. It returns StringIndexOutOfBoundsException if given index number is greater than or equal to this string length or a negative number. Java String charAt() method example public class CharAtExample{ public […]

Java String

Java String is an object that represents sequence of char values.Java implements strings as objects of type String. An array of characters works same as Java string. For example, Java has methods to compare two strings, search for a substring, concatenate two strings, and change the case of letters within a string. No. Method Description […]

Components of a computer system

Basic Operations or Functional Components of Computer Computer Organisation/Block diagram of computer Input: This is the process of entering data and programs into the computer system. Input devices areKeyboard.,Image scanner,Microphone,Pointing device, Graphics tablet, Joystick, Light pen, Mouse, Optical, Pointing stick, Touchpad, Touchscreen, Trackball,Webcam, Softcam etc. Control Unit (CU): The process of input, output, processingand storage […]

Characteristics of a computer

Speed A computer works with much higher speed and accuracy compared to humans while performing mathematical calculations. Computers can process millions (1,000,000) of instructions per second. The time taken by computers for their operations is microseconds and nanoseconds. Accuracy Computers perform calculations with 100% accuracy. Errors may occur due to data inconsistency or inaccuracy. Diligence […]

Java Object Oriented Programming (OOPs) Concepts

Java is an Object Oriented Programming language. There are many object oriented features in java such as Inheritance, Polymorphism, Abstraction, Encapsulation etc.

The first object-oriented programming language is Simula.
Java is known as truly object-oriented programming language because all java programs is written in class.

Short Name Format Program in Java

Short Name Format Program in Java

1 10 11 12 13 14 36