Data types are used to represent type of the variable & expressions.Representing how much memory is allocated for variable.Specifies range value of the variable. There are 8 primitive data types in java Data Type size(in bytes) Range default values byte 1 -128 to 127 0 short 2 -32768 0 int 4 -2147483648 to 2147483647 0Continue reading “What is java primitive data types”
Author Archives: Atul maurya
What are java identifiers
Every name in java is called identifier such as, Class-name Method-name Variable-name Rules to declare identifier: An identifier contains group of Uppercase & lower case characters, numbers ,underscore & dollar sign characters but not start with number. int abc=10; —> valid int _abc=30; —> valid int $abc=40; —>valid int a-bc=50; —>not valid int 2abc=20; —> Invalid Continue reading “What are java identifiers”
Escape Sequences in java
A character preceded by a backslash (\) is an escape sequence and has special meaning to the compiler. The following table shows the Java escape sequences
What are Java tokens
Smallest individual part of a java program is called Token. It is possible to provide any number of spaces in between two token Example:- class Test { public static void main(String args[]) { System.out.println(“hi this is Atul”); } } Tokens are———àclass , test , { ,”,[ …..etc
Difference between println() and print() methods in java
Println():- used to print the statements in console but the control is there in next line. Example:- System.out.println(“Sravyainfotech”); System.out.println(“core java”); Output: – Sravyainfotech Core java Print():- used to print the statement in console and the control is present in the same line. Example:- System.out.print(“Sravyainfotech”); System.out.print(“core java”); Output:-SravyaInfotechcorejava
Separators in java
Symbol name usage ( ) parentheses used to contains list of parameters & contains expression. { } braces block of code for class, method, constructors & local scopes. [ ] brackets used for array declaration. ; semicolon terminates statements. , comma separate the variables declaration & chain statements in for. . period used to separateContinue reading “Separators in java”
How to write comments in java
Comments are used to write the detailed description about application logics to understand the logics easily. Comments are very important in real time because today we are developing the application but that application maintained by some other person so to understand the logics by everyone writes the comments. Comments are non-executable code these are ignoredContinue reading “How to write comments in java”
Steps to Design first java application
Step-1:- Select an Editior. Step-2:-Write the application. Step-3:-Save the application. Step-4:-Compilation Process. Step-5:-Execution Process. Step1:- Select an Editor Editor is a tool or software it will provide very good environment to develop java application. Ex :- Notepad, Notepad++,edit Plus…..etc IDE:- ( Integrated development Environment ) IDE is providing very good environment to develop the application.Continue reading “Steps to Design first java application”
Java coding convention
Classes:- Class name start with upper case letter and every inner word starts with upper case letter. This convention is also known as camel case convention. The class name should be nouns. Ex:- String StringBuffer InputStreamReader ……etc Interfaces :- Interface name starts with upper case and every inner word starts with upper case letter. ThisContinue reading “Java coding convention”
How to set path in java
Install the software and set the path :- Download the software. Install the java software in your machine. Set the environmental variable. Download the software:- ü Download the software from internet based on your operating system & processor because the software is different from operating system to operating system & processor to processor. Install theContinue reading “How to set path in java”