Posts

Variables of Java

Next Java Variables Variables are containers that store information that can be manipulated and referenced later by the programmer within the code. Java variables have a data type associated with them which can tell us about the size and layout of the variable’s memory. datatype variable = value There are three types of comments: Local variable Instance variable Class/static variable Local variable A variable which is declared inside the method is called local variable.Inside the method body, A local variable lies only within the method or constructor within which it is created and other methods in the class cannot access it. Local variable is declared using the static keyword. Example public class LocalVariableEx { public void localVariable() { String name = "Tony"; int ma

Comments in Java

Next Comments in Java Comments in any programming language are ignored by the compiler or the interpeter. The programmer uses it to either explain a block of code or to avoid the execution of a specific part of the code while testing. There are two types of comments: Single-line comment Multi-line comment Single/In-line comment To write a single-line comment just add a ‘//’ at the start of the line. Example public class Main { public static void main ( String [ ] args ) { //This is a single line comment System . out . println ( "Hello learnwithvaigandla" ) ; } } Output Hello learnwithvaigandla Multi-line comment To write a multi-line comment just add a ‘/*…….*/’ at the start of the line. Exa

Data types in Java

Image
Next Data types in Java Data types represent the different values to be stored in the variable. There are two forms of Data types in Java Primitive data type Non-primitive data type Data Type Size (in bytes) Range byte 1 -128 to 127 short 2 -32,768 to 32,767 int 4 -2,147,483,648 to 2,147,483,647 long 8 -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 float 4 Approximately ±3.40282347E+38F

Simple program in Java | Hello world Example

Next Simple program in Java | Hello world Example We will create a file called Main.java and we use the following code to print "Hello learnwithvaigandla" to the screen. Main.java public class Main { public static void main ( String [ ] args ) { System . out . println ( "Hello learnwithvaigandla" ) ; } } Every line of code that runs in Java must be inside a class. In our example, we named the class Main. A class should always start with an uppercase first letter. Note: Java case sensitive so that 'Class' and 'class' has different meaning. The name of the file is must match with the class name. when you are saving the file, save it using class name and add '.java' to the end of the filename.

Applications of Java

Next Applications of Java Types of Java Application There are so many types of applications that can be created using Java programming, it gives lot of possibilities when it comes to create applications. In this article we will delve into different types of Java applications, Providing you with valuable insights, functionalities and their uses. Standalone Applications Web Applications Enterprise Applications Mobile Applications Scientific and Numerical Computing Financial Applications Internt of Things(IoT) Big Data Technologies There are mainly 4 type of applications that can be created using java programming: 1.Standalone Applications: Standalone Application is also known as desktop application or window-based application. An application that we need to install on local machin

What is Object Oriented Programming in Java?

Image
Next Object Oriented Programming Java is an Object-Oriented Programming Language.Everything in JAVA is an Object. Object-oriented means we organize our software as a combination of different types of objects that incorporates both data and behaviour. Principles of Object-Oriented Programming The object-oriented paradigm supports four major principles ,they are also known as four pillars of the object-oriented paradigm. Encapsulation Abstraction Inheritance Polymorphism Class Object 1.Encapsulation: Wrapping data(variables) and methods(code acting on data) within classes in combination with implementation hiding (through access control) is often called encapsulation. In java encapsulation can be achieved

Features of JAVA

Image
Next The Features of JAVA Programming Language Simple Object-oriented Portable Platform Independent Secured Robust (refers to the quality of being strong) Architecture neutral Interpreted High performance Multithreaded Distributed Dynamic These are the features in the JAVA Programming Language. For more explanation, please continue reading. Explination of Features in JAVA Programming Language Simple Java is very easy to learn, and its syntax is simple, clean and easy to understand. According to Sun, Java language is a simple programming language because: Java syntax is based on C++ (so easier for programmers to learn it after C++). Java has removed many complicated and rarely-used features, for example, explicit pointers, operator overloading, etc.

A Comprehensive Guide to Java and Its Applications: Exploring the Versatility of Java Programming

Next   What is Java? Java is a Widely-used Programming language for coding web applications. It has been a popular choice among developers, with millions of Java applications in use today. Java is a multi-platform, object-oriented, and network-centric language that can be used as a platfrom in itself. It is fast, secure, reliable programming language for coding everything from mobile application , web applications and standalone applications to enterprise softwares. History of Java Java is an efficient powerful Object-Oriented Programming language developed in the year of 1991 by James Gosling and his team members at Sun micro systems. James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991. The small team of sun