Posts

Showing posts with the label Java

Java Fundamentals

Image
Allow nothing  or  no one  to  slow your pace  or affect  your  energy;  stay consistently flowing , forever growing. Subject: Java Fundamentals Topics: Arithmetic Operators Basic Operators: + - * / % Prefix/Post fix Operators:  ++  -- Compound/Assignment Operators:  +=  -=   /=   *=   %= Basic Operators Example: public class BasicOperators { public static void main(String[] args) { /** * Floating Point Examples */ //Addition of two variables float valAddA = 1.0f; float valAddB = 2.0f; System.out.println("valAddA + valAddB: " + (valAddA + valAddB)); //Subtraction of two variables float valSubA = 5.0f; float valSubB = 4.0f; System.out.println("valSubA - valSubB: " + (valSubA - valSubB)); //Multiplication of two...

Java Fundamentals

Image
“When we compare ourselves to others, we reject ourselves. In the moment, we’re defined by that breadth of comparison rather than the extraordinary uniqueness that makes us who we are.” . Subject: Java Fundamentals Topics: Primitive Data Types for Variables Integer Floating Character Boolean Data Types - Size in Bits - Min Value - Max Value - Literal Format Integer Types: long type: uses literal formal 'L' Floating Types: float type: uses literal format 'f' double type: uses literal format 'd' Character Types: Literal values are stored in single quotes. Also stores unicode characters. Boolean Types: Stores either True or False Primitive Data Types are stored by Value.

Java Fundamentals

Image
" It always seems impossible until it's done ." Subject: Java Fundamentals Topics: Variables Declaration of Variables Assignment of Values to Variables Variables = Ability to store and manipulate values (Named Data Storage) Declaration and Assignment of Values in a single statement Naming Variables Combination of Rules and Conventions. Rules: Allows use of letters, numbers, $ and underscore Convention: Only letters and numbers are used. Rules: First character is not a number Convention: First character is always a letter Convention: Follow "Camel Casing" First letter is lowerCase Start of each word after first is UpperCase All other letters are lower case. We can assign a value to variable and later modify it to other. Local Variables:  Variables declared inside the main method public class Variables { public static void main(String[] args) { /** * Declaring only the local variable an...

Java Fundamentals

Image
"Move out of your comfort zone.  You can only grow if you are willing to feel awkward and uncomfortable  when you try something new." Subject: Java Fundamentals Topics: Statements Structure Statements ends with semicolon. Comments  Usage of Comments in code Types of Comments Line Comments Block Comments Java Doc Comments What is package Package Naming Conventions Example: package com.strls.testing.learnjava Correlation between package names and Source file structure. Before adding package name to the java file. Structure of Folders in IDE. src -> main.java After adding package name to java file. Structure of Folders in IDE. src -> com -> strls -> testing -> learnjava -> HelloWorldOrganized -> main.java package com.strls.testing.learnjava; public class HelloOrganized { public static void main(String[] args) { System.out.println("Hello Get Organized"); } }

Java Fundamentals

Image
If you  learn something new every day , you can teach  something new every day . Subject: Java Fundamentals Topics: Verifying Java JDK installation is correct or not from command line. Installation of Eclipse IDE Creating a Simple Java Application. (Hello World Program) /** * This class implements the HelloWorld program * @author srinivas.kadiyala * @version 1.0 * */ public class HelloWorld { /* * Using comments in HelloWorld */ public static void main(String[] args) { //Hello World Program System.out.println("Hello World Again"); //Hello World Output - Spaces within the braces System.out.println( "Hello World before Space in braces"); //Hello World Output - Spaces outside the spaces System.out.println("Hello world before space outside braces") ; //Hello World Output - New Line a...

Java Fundamentals

Image
Learn Something New Every Day (And Actually Do Something With It) Subject: Java Fundamentals Topics: What is Java JRE vs JDK  Installation of Java How Java code converts to Class File What is IDE Popular IDE's available NetBeans Eclipse IntelliJ Idea