Fourth Class of Java
Fourth Class of Java
1. class A
System.out.print(“hello”);
System.out.print(“hi”);
Note :- Class name is, basically, the program name where your program
is saved on the hard disk. Class name must not be a java reserved word.
But class name should be meaningful and relevant to your program.
Output:- hellohi
2.class B
System.out.println(“hello”);
System.out.println(“hi”);
}
}
Output:-hello
Hi
VARIABLES
Variables are the storage locations inside our computer memory where
any value can be stored. Since the value which is going to be stored is
not fixed, that is why it is called as variable.
DATA TYPES
Data types are used to specify the size and type of value to be stored by
a variable. During programming we deal with various types of data. It
becomes necessary for a programmer to select an appropriate data
type according to the need of a program.
Types
Classes
Interfaces
Identifiers
Where data type may be int, float, char, double, boolean etc.
char ch;
float sum,sub;
Valid identifiers: -
Invalid identifiers: -
It means
But