Posts

How to compare strings correctly [JAVA Tip]

The main objective of this post is to explain the correct method of comparing the strings in Java. Can you answer the following quiz?  * QUIZ: Guess output of the following code snippet: String osName = System.getProperty(“osName”); if (osName.equals(“Windows”)) {        System.out.println(“You’re using Windows”); }   For now, let write down your answer on paper. I will let you know the correct answer at the end of this post. Friends, why I want you to answer the quiz above? Well, it’s because I’m going to share a tip about Strings comparison today. * Why Strings comparison? It sounds very simple, but do you know that you have to compare Strings in every coding day of your entire life? Unless you die or you don’t coding any more, comparing Strings is your day-to-day chore, like you eat and drink. I want to tell you about the comparison of a String variable against a String constant as shown in the code snippet above: String osName = System.getProp...

How to run Java program from CMD

Let's say your file is in C:\mywork\ Run Command Prompt C:> cd \mywork This makes C:\mywork the current directory. C:\mywork> javac filenamehere.java This runs javac.exe, the compiler. You should see nothing but the next system prompt... C:\mywork> dir javac has created the filenamehere.class file. You should see filenamehere.java and filenamehere.class among the files. C:\mywork> java filenamehere This runs the Java interpreter. You should then see your program output. If the system cannot find javac, check the set path command. If javac runs but you get errors, check your Java text. If the program compiles but you get an exception, check the spelling and capitalization in the file name and the class name and the java HelloWorld command. Java is case-sensitive!

How to Install the Java Software Development Kit (JDK)

Image
Before you can create and modify Java programs, you’ll need the Java Software Development Kit. You can download the kit (also known as Java SDK or JDK) for free from Oracle as a single installer file, which makes installation quick and easy. Learn the best way to download and install the Java Software Development Kit on your Windows, macOS, or Linux system. PART 1. Step 1.  Downloading the Java Software Development Kit Navigate to http://www.oracle.com/technetwork/java/javase/downloads/index.html . You can download a simple Java Software Development Kit (JDK) installer for Windows, macOS, or Linux directly from Oracle. Step 2.  Click the “Download” button beneath “JDK. ” This will open a new page containing several download options. Step 3.  Scroll to the latest version of Java SE Development Kit. You should always use the latest stable version of the toolkit. There may be more than one version listed, so look closely at the release number. For example, if you are presented with JD...

Having problems!!!!!

Hey friends, I know all of you are studying, learning new languages, gaining technical knowledge etc. Some of having problems like programs are not running due to errors in C, C++, JAVA etc. Or don't understanding some topics because of high level definitions. Actually we also suffer from that, that's why I am presenting here this post for you, so that you can ask about problems, you'll get your solution in atmost 24 hours. Fill the contact form given below or you can just comment at this post.   [contact-form subject="Problem Request from Tech Blicks"][contact-field label="Name" type="name" required="1" /][contact-field label="Email" type="email" required="1" /][contact-field label="Problem Related to" type="select" options="C,C++,JAVA,IWT,Microprocessor,Data Structure,Computer Hardware,Others" required="1" /][contact-field label="Comment" type="text...

Introduction to Computer Languages

Low Level Languages Low-level languages are designed to operate and handle the entire hardware and instructions set architecture of a computer directly. Low-level languages are considered to be closer to computers. In other words, their prime function is to operate, manage and manipulate the computing hardware and components. Programs and applications written in low-level language are directly executable on the computing hardware without any interpretation or translation. In simple language, low-level language are machine or computer understandable. Machines understand only Low-Level Language. Machine language and assembly language are popular examples of low level languages.   High Level Languages High level languages are designed to be used by the human operator or the programmer. They are referred to as "closer to humans." In other words, their programming style and context is easier to learn and implement, and the entire code generally focuses on the specific program to b...

Java Applets and Applications

Java can be used to create two types of programs: applications and applets. An application is a program that runs on your computer, under the operating system of that computer. When used to create applications, Java is notuch different from any other computer language. An Applet is an application designed to be transmitted over the Internet and executed by a Java-compatible Web browser. An applet is actually a tiny program, dynamically downloaded across the network, just like an image, sound file, or video clip. The important difference is that an applet is an intelligent program, not just an animation or media file.

Advantages of JAVA

The various advantages of java are Simple Secure Portable Object-Oriented Robust Multi Threaded Architecture-neutral Interpreted High Performance Distributed Dynamic Let's examine what each of the others implies Simple Java was designed to be easy for the professional programmer to learn and use effectively.if you already understand the basic concepts of object - oriented programming, learning java will be even easier. Java inherits the C/C++ syntax and many of the object - oriented features of C++, most programmers have little trouble learning java. Secure When you use a java-compatible Web browser, you can safely download java applets without any fear of viral infection or malicious intent. Java achieves this protection by confining a java program to the java execution environment and not allowing it access to other parts of the computer. Portable For programs to be dynamically downloaded to all the various types of platforms connected to the Internet, some ...