java

 

How to Print Diamond Pattern in Java Programming Language?

Print Diamond Pattern To print diamond pattern in Java Programming, you have to use six for loops, the first for loop (outer loop) contains two for loops, in which the first for loop is to print the spaces, and the second for loop print the stars to make the pyramid of stars. Now the second for loop (outer loop) also contains the two for loop, in which the first for loop …

How to Print Diamond Pattern in Java Programming Language? Read More »

How to Print Patterns of Numbers and Stars in java programming language?

To print patterns of numbers and stars (*) in Java Programming, you have to use two loops, first is an outer loop and the second is the inner loop. The outer loop is responsible for rows and the inner loop is responsible for columns. Java Programming Code to Prints Patterns Following are the one by …

How to Print Patterns of Numbers and Stars in java programming language? Read More »

Most Important Commonly Asked Java Programming Interview Questions

Dear readers, these Java programming Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of Java Programming Language. As per my experience, good interviewers hardly planned to ask any particular question during your interview, normally questions start with some basic concept …

Most Important Commonly Asked Java Programming Interview Questions Read More »

Why Java?

Why Java? Java is one of the world’s most important and widely used computer languages, and it has held this distinction for many years. Unlike some other computer languages whose influence has worn with the passage of time, while Java’s has grown. As of 2015, Java is one of the most popular programming languages in …

Why Java? Read More »

What is Java virtual Machine(JVM)?

What is Java virtual Machine(JVM)? Java Virtual Machine(JVM)  provides runtime environment to execute java byte code. The JVM doesn’t understand Java typo, that’s why you compile your *.java files to obtain *.class files that contain the bytecodes understandable by the JVM. JVM control execution of every Java program. It enables features such as automated exception …

What is Java virtual Machine(JVM)? Read More »

My first Java Program

My first Java Program class Hello { public static void main(String[] args) { System.out.println (“Hello World program”); } } class : class keyword is used to declare classes in Java public : It is an access specifier. Public means this function is visible to all. static : static is again a keyword used to make …

My first Java Program Read More »

Data Types in Java

Java language has a rich implementation of data types. Data types specify size and the type of values that can be stored in an identifier. In java, data types are classified into two catagories : Primitive Data type Non-Primitive Data type 1) Primitive Data type A primitive data type can be of eight types : …

Data Types in Java Read More »

Type Casting IN JAVA

Type Casting IN JAVA Assigning a value of one type to a variable of another type is known as Type Casting. Example : int x = 10; byte y = (byte)x; In Java, type casting is classified into two types, Widening Casting(Implicit) Narrowing Casting(Explicitly done) Widening or Automatic type converion Automatic Type casting take place …

Type Casting IN JAVA Read More »

Variables in java

Variables in java Java Programming language defines mainly three kind of variables. Instance variables Static Variables Local Variables 1) Instance variables Instance variables are variables that are declare inside a class but outside any method,constructor or block. Instance variable are also variable of object commonly known as field or property. class Student { String name; …

Variables in java Read More »

Concept of Array in Java

An array is a collection of similar data types. Array is a container object that hold values of homogeneous  type. It is also known as static data structure because size of an array must be specified at the time of its declaration. An array can be either primitive or reference type. It gets memory in heap …

Concept of Array in Java Read More »

Java Operators

Java provides a rich set of operators enviroment. Java operators can be devided into following categories Arithmetic operators Relation operators Logical operators Bitwise operators Assignment operators Conditional operators Misc operators Arithmetic operators Arithmetic operators are used in mathematical expression in the same way that are used in algebra. operator description + adds two operands – …

Java Operators Read More »

Command line argument in Java

The command line argument is the argument passed to a program at the time when you run it. To access the command-line argument inside a java program is quite easy, they are stored as string in String array passed to the args parameter of main() method. Example class cmd { public static void main(String[] args) …

Command line argument in Java Read More »

Java Package

Package are used in Java, in-order to avoid name conflicts and to control access of class, interface and enumeration etc. A package can be defined as a group of similar types of classes, interface, enumeration and sub-package. Using package it becomes easier to locate the related classes. Package are categorized into two forms Built-in Package:-Existing …

Java Package Read More »

Abstract class in java

If a class contain any abstract method then the class is declared as abstract class. An abstract class is never instantiated. It is used to provide abstraction. Although it does not provide 100% abstraction because it can also have concrete method. Syntax : abstract class class_name { } Abstract method Method that are declared without …

Abstract class in java Read More »

Object and Classes in java

Object and Classes Since Java is an object oriented language, complete java language is build on classes and object. Java is also known as a strong Object oriented programming language(oops). OOPS is a programming approach which provides solution to problems with the help of algorithms based on real world. It uses real world approach to …

Object and Classes in java Read More »

Methods in Java

Method describe behavior of an object. A method is a collection of statements that are group together to perform an operation. Syntax : return-type methodName(parameter-list) { //body of method } Example of a Method public String getName(String st) { String name=”StudyTonight”; name=name+st; return name; } Modifier : Modifier are access type of method. We will …

Methods in Java Read More »

Constructors in Java

Constructors in Java A constructor is a special method that is used to initialize an object.Every class has a constructor, if we don’t explicitly declare a constructor for any java class the compiler builds a default constructor for that class. A constructor does not have any return type. A constructor has the same name as …

Constructors in Java Read More »

Scroll to Top