Tuesday, 4 July 2017
Sunday, 25 June 2017
- June 25, 2017
- Dipak kumar singh
- Feature of java
- No comments
Features of Java
Features of any programming language is nothing but the service or basic facilities provided by the language to the programmers. The java language provides the following features.
Simple:-
- Looks familiar to existing programmers: related to C and C++:
- Omits many rarely used, poorly understood, confusing features of C++, like operator overloading, multiple inheritance, automatic coercions, etc.
- Contains no goto statement, but break and continue
- Has no header files and eliminated C preprocessor
- Eliminates much redundancy (e.g. no structs, unions, or functions)
- has no pointers
- Added features to simplify:
- Garbage collection, so the programmer won't have to worry about storage management, which leads to fewer bugs.
- A rich predefined class library
Object-Oriented:-
Java is an object-oriented language, which means that you focus on the data in your application and methods that manipulate that data, rather than thinking strictly in terms of procedures.
In an object-oriented system, a class is a collection of data and methods that operate on that data. Taken together, the data and methods describe the state and behavior of an object. Classes are arranged in a hierarchy, so that a subclass can inherit behavior from its superclass.
Java comes with an extensive set of classes, arranged in packages, that you can use in your programs.
Portable:-
java goes further than just being architecture-neutral:Platform Independent:-
A platform is the hardware or software environment in which a program runs.
There are two types of platforms software-based and hardware-based. Java provides software-based platform.
The Java platform differs from most other platforms in the sense that it is a software-based platform that runs on the top of other hardware-based platforms. It has two components:- Runtime Environment
- API(Application Programming Interface)
Java code can be run on multiple platforms e.g. Windows, Linux, Sun Solaris, Mac/OS etc. Java code is compiled by the compiler and converted into bytecode. This bytecode is a platform-independent code because it can be run on multiple platforms i.e. Write Once and Run Anywhere(WORA).
Secured:-
Security is an important concern, since Java is meant to be used in networked environments. Without some assurance of security, you certainly wouldn't want to download an applet from a random site on the net and let it run on your computer. Java's memory allocation model is one of its main defenses against malicious code (e.g can't cast integers to pointers, so can't forge access). Furthermore:
access restrictions are enforced (public, private)
byte codes are verified, which copes with the threat of a hostile compiler
Robust:-
Java has been designed for writing highly reliable or robust software:Architectural neutral:-
Dynamic:-
Java was designed to adapt to an evolving environment:
Even after binaries have been released, they can adapt to a changing environment
Java loads in classes as they are needed, even from across the network
It defers many decisions (like object layout) to runtime, which solves many of the version problems that C++ has
Dynamic linking is the only kind there is
Interpreted:-
It is one of the highly interpreted programming languages.
High performance:-
Java is faster than traditional interpretation since byte code is "close" to native code still somewhat slower than a compiled language (e.g., C++)Multi-threaded:-A thread is like a separate program, executing concurrently. We can write Java programs that deal with many tasks at once by defining multiple threads. The main advantage of multi-threading is that it doesn't occupy memory for each thread. It shares a common memory area. Threads are important for multi-media, Web applications etc.Distributed:-
We can create distributed applications in java. RMI and EJB are used for creating distributed applications. We may access files by calling the methods from any machine on the internet.
|
Saturday, 24 June 2017
- June 24, 2017
- Dipak kumar singh
- No comments
How to Set Path and Classpath in Java
Path Variable
Path variable is set for providing path for all Java tools like java, javac, javap, javah, jar, appletviewer which are used in java programming. All these tools are available in bin folders so we set path upto bin folders.
Classpath Variable
Classpath variable is set for providing a path for predefined Java classes which is used in our application. All classes are available in lib/rt.jar so we set classpath upto lib/rt.jar.
Why set path ?
The following programming error is generally for all Java programmers when they compile any Java program.
'javac' is not recognized as an internal or external command, operable program or batch file.
When you get this type of error, then your operating system cannot find the Java compiler (javac). To solve this error you need to set the PATH variable.
Javac is a tool which is available in bin folder so you must set the PATH upto bin folder. In a bin folder all tools are available like javap, javah, jar, javac, java, appletviewer etc. All these tools are used for different-different purpose.
set the path and classpath
Go on my computer icon and right click, after that click on properties option.
Now click on advance setting
Click on advance
Click on Advance variables
Click on new button which is below the first box.
Now one dilog box is appear, now ignore this but do not close.
Now open my computer open c:/ > Programs Files > java > java1.6.0 > bin copy this path
Now come back on previous open dilogbox and write variable name 'path' and for variable value paste all copied path upto the bin folder. Put .; at the end. It (.) selects all the tools from the bin folder.
Now open my computer open c:/ > Programs Files > java > java1.6.0 > jre > lib > rt.jar copy this path
Note: rt.jar is available in lib folder this jar files contains all classes of jdk.
Now again come back on Environment variable dilogbox and click on new. Now one box is open and write path variable as 'classpath' and for variable value paste all copied paths upto rt.jar. Put .; at the end. It (.) selects all the classes from lib folder.
NOTE:-Finally after set classpath Restart your system, or you can re-open command prompt
- June 24, 2017
- Dipak kumar singh
- No comments
differences are like...
1).Path is an environment variable which is used by the operating system to find the executables.
Classpath is an environment variable which is used by the Java compiler to find the path, of classes.ie in J2EE we give the path of jar files.
2).PATH is nothing but setting up an environment for operating system. Operating System will look in this PATH for executables.
Classpath is nothing but setting up the environment for Java. Java will use to find compiled classes
3).Path refers to the system while classpath refers to the Developing Envornment.
In path we set the path of executables while in
classpath we set path of jars for compiling classes.
Friday, 23 June 2017
- June 23, 2017
- Dipak kumar singh
- No comments
History of Java
Java language developed by company Sun Microsystems and the creator is Jamesh Gosling.
Story behind development of Java
Sun Microsystems Started by a group of the students who are studing in Standard University. These people found the problem in their room with electronic consumable remote. That means one electronic consumable control doesn't work on another electronics consumable. These people want to develop a common remote control which is controlling all the electronic consumables so they contact James Gosling and requested for the projects. Sun Microsystems started by a group of students out of them one person also Indian whose name Vinode Khosla.
James Gosling and his team members given the project name as Green started in the year 1990 and common remote control completed in the year 1992.
The James Gosling team develops a new language called as OAK But this name is already selected by any other company renamed as Java, but Java has no meaning representation of Island in Indonesia. The unofficial abbreviation of Java is Just Another Virtual Analyzer (JAVA).
Java Version History
Now a day 8 versions of java are released, which is listed below with realizing date.
- JDK Alpha and Beta (1995)
- JDK 1.0 (23rd Jan, 1996)
- JDK 1.1 (19th Feb, 1997)
- J2SE 1.2 (8th Dec, 1998)
- J2SE 1.3 (8th May, 2000)
- J2SE 1.4 (6th Feb, 2002)
- J2SE 5.0 (30th Sep, 2004)
- Java SE 6 (11th Dec, 2006)
- Java SE 7 (28th July, 2011)
- Java SE 8 (18th March, 2014)
- June 23, 2017
- Dipak kumar singh
- No comments
Introduction to java programming
Java is a programming language created by James Gosling from Sun Microsystems (Sun) in 1991. The target of Java is to write a program once and then run this program on multiple operating systems. The first publicly available version of Java (Java 1.0) was released in 1995. Sun Microsystems was acquired by the Oracle Corporation in 2010. Oracle has now the steermanship for Java. In 2006 Sun started to make Java available under the GNU General Public License (GPL). Oracle continues this project called OpenJDK.
Monday, 8 May 2017
- May 08, 2017
- Dipak kumar singh
- ASCII character codes
- No comments
Table of 8-bit ASCII Character Codes
HTTPS://EASYTOJAVALEARNER.BLOGSPOT.COM
Characters in 8-bit ASCII.
Decimal | Octal | Hex | Binary | Value | Description |
000 | 000 | 000 | 0000 0000 | NUL | "null" character |
001 | 001 | 001 | 0000 0001 | SOH | start of header |
002 | 002 | 002 | 0000 0010 | STX | start of text |
003 | 003 | 003 | 0000 0011 | ETX | end of text |
004 | 004 | 004 | 0000 0100 | EOT | end of transmission |
005 | 005 | 005 | 0000 0101 | ENQ | enquiry |
006 | 006 | 006 | 0000 0110 | ACK | acknowledgment |
007 | 007 | 007 | 0000 0111 | BEL | bell |
008 | 010 | 008 | 0000 1000 | BS | backspace |
009 | 011 | 009 | 0000 1001 | HT | horizontal tab |
010 | 012 | 00A | 0000 1010 | LF | line feed |
011 | 013 | 00B | 0000 1011 | VT | vertical tab |
012 | 014 | 00C | 0000 1100 | FF | form feed |
013 | 015 | 00D | 0000 1101 | CR | carriage return |
014 | 016 | 00E | 0000 1110 | SO | shift out |
015 | 017 | 00F | 0000 1111 | SI | shift in |
016 | 020 | 010 | 0001 0000 | DLE | data link escape |
017 | 021 | 011 | 0001 0001 | DC1 | device control 1 (XON) |
018 | 022 | 012 | 0001 0010 | DC2 | device control 2 |
019 | 023 | 013 | 0001 0011 | DC3 | device control 3 (XOFF) |
020 | 024 | 014 | 0001 0100 | DC4 | device control 4 |
021 | 025 | 015 | 0001 0101 | NAK | negative acknowledgement |
022 | 026 | 016 | 0001 0110 | SYN | synchronous idle |
023 | 027 | 017 | 0001 0111 | ETB | end of transmission block |
024 | 030 | 018 | 0001 1000 | CAN | cancel |
025 | 031 | 019 | 0001 1001 | EM | end of medium |
026 | 032 | 01A | 0001 1010 | SUB | substitute |
027 | 033 | 01B | 0001 1011 | ESC | escape |
028 | 034 | 01C | 0001 1100 | FS | file separator |
029 | 035 | 01D | 0001 1101 | GS | group separator |
030 | 036 | 01E | 0001 1110 | RS | request to send/record separator |
031 | 037 | 01F | 0001 1111 | US | unit separator |
032 | 040 | 020 | 0010 0000 | SP | space |
033 | 041 | 021 | 0010 0001 | ! | exclamation mark |
034 | 042 | 022 | 0010 0010 | " | double quote |
035 | 043 | 023 | 0010 0011 | # | number sign |
036 | 044 | 024 | 0010 0100 | $ | dollar sign |
037 | 045 | 025 | 0010 0101 | % | percent |
038 | 046 | 026 | 0010 0110 | & | ampersand |
039 | 047 | 027 | 0010 0111 | ' | single quote |
040 | 050 | 028 | 0010 1000 | ( | left/opening parenthesis |
041 | 051 | 029 | 0010 1001 | ) | right/closing parenthesis |
042 | 052 | 02A | 0010 1010 | * | asterisk |
043 | 053 | 02B | 0010 1011 | + | plus |
044 | 054 | 02C | 0010 1100 | , | comma |
045 | 055 | 02D | 0010 1101 | - | minus or dash |
046 | 056 | 02E | 0010 1110 | . | dot |
047 | 057 | 02F | 0010 1111 | / | forward slash |
048 | 060 | 030 | 0011 0000 | 0 | |
049 | 061 | 031 | 0011 0001 | 1 | |
050 | 062 | 032 | 0011 0010 | 2 | |
051 | 063 | 033 | 0011 0011 | 3 | |
052 | 064 | 034 | 0011 0100 | 4 | |
053 | 065 | 035 | 0011 0101 | 5 | |
054 | 066 | 036 | 0011 0110 | 6 | |
055 | 067 | 037 | 0011 0111 | 7 | |
056 | 070 | 038 | 0011 1000 | 8 | |
057 | 071 | 039 | 0011 1001 | 9 | |
058 | 072 | 03A | 0011 1010 | : | colon |
059 | 073 | 03B | 0011 1011 | ; | semi-colon |
060 | 074 | 03C | 0011 1100 | < | less than |
061 | 075 | 03D | 0011 1101 | = | equal sign |
062 | 076 | 03E | 0011 1110 | > | greater than |
063 | 077 | 03F | 0011 1111 | ? | question mark |
064 | 100 | 040 | 0100 0000 | @ | "at" symbol |
065 | 101 | 041 | 0100 0001 | A | |
066 | 102 | 042 | 0100 0010 | B | |
067 | 103 | 043 | 0100 0011 | C | |
068 | 104 | 044 | 0100 0100 | D | |
069 | 105 | 045 | 0100 0101 | E | |
070 | 106 | 046 | 0100 0110 | F | |
071 | 107 | 047 | 0100 0111 | G | |
072 | 110 | 048 | 0100 1000 | H | |
073 | 111 | 049 | 0100 1001 | I | |
074 | 112 | 04A | 0100 1010 | J | |
075 | 113 | 04B | 0100 1011 | K | |
076 | 114 | 04C | 0100 1100 | L | |
077 | 115 | 04D | 0100 1101 | M | |
078 | 116 | 04E | 0100 1110 | N | |
079 | 117 | 04F | 0100 1111 | O | |
080 | 120 | 050 | 0101 0000 | P | |
081 | 121 | 051 | 0101 0001 | Q | |
082 | 122 | 052 | 0101 0010 | R | |
083 | 123 | 053 | 0101 0011 | S | |
084 | 124 | 054 | 0101 0100 | T | |
085 | 125 | 055 | 0101 0101 | U | |
086 | 126 | 056 | 0101 0110 | V | |
087 | 127 | 057 | 0101 0111 | W | |
088 | 130 | 058 | 0101 1000 | X | |
089 | 131 | 059 | 0101 1001 | Y | |
090 | 132 | 05A | 0101 1010 | Z | |
091 | 133 | 05B | 0101 1011 | [ | left/opening bracket |
092 | 134 | 05C | 0101 1100 | \ | back slash |
093 | 135 | 05D | 0101 1101 | ] | right/closing bracket |
094 | 136 | 05E | 0101 1110 | ^ | caret/circumflex |
095 | 137 | 05F | 0101 1111 | _ | underscore |
096 | 140 | 060 | 0110 0000 | ` | |
097 | 141 | 061 | 0110 0001 | a | |
098 | 142 | 062 | 0110 0010 | b | |
099 | 143 | 063 | 0110 0011 | c | |
100 | 144 | 064 | 0110 0100 | d | |
101 | 145 | 065 | 0110 0101 | e | |
102 | 146 | 066 | 0110 0110 | f | |
103 | 147 | 067 | 0110 0111 | g | |
104 | 150 | 068 | 0110 1000 | h | |
105 | 151 | 069 | 0110 1001 | i | |
106 | 152 | 06A | 0110 1010 | j | |
107 | 153 | 06B | 0110 1011 | k | |
108 | 154 | 06C | 0110 1100 | l | |
109 | 155 | 06D | 0110 1101 | m | |
110 | 156 | 06E | 0110 1110 | n | |
111 | 157 | 06F | 0110 1111 | o | |
112 | 160 | 070 | 0111 0000 | p | |
113 | 161 | 071 | 0111 0001 | q | |
114 | 162 | 072 | 0111 0010 | r | |
115 | 163 | 073 | 0111 0011 | s | |
116 | 164 | 074 | 0111 0100 | t | |
117 | 165 | 075 | 0111 0101 | u | |
118 | 166 | 076 | 0111 0110 | v | |
119 | 167 | 077 | 0111 0111 | w | |
120 | 170 | 078 | 0111 1000 | x | |
121 | 171 | 079 | 0111 1001 | y | |
122 | 172 | 07A | 0111 1010 | z | |
123 | 173 | 07B | 0111 1011 | { | left/opening brace |
124 | 174 | 07C | 0111 1100 | | | vertical bar |
125 | 175 | 07D | 0111 1101 | } | right/closing brace |
126 | 176 | 07E | 0111 1110 | ~ | tilde |
127 | 177 | 07F | 0111 1111 | DEL | delete |
Subscribe to:
Posts (Atom)