Write a program to perform bit wise operation?

import java.lang.*; public class BitWise {                 public static void main(String x[])                 {                                 byte a=8,b=4;                                 System.out.println("AND operation : "+(a&b));                                 System.out.println("OR operation : "+(a|b));                                 System.out.println("Complement : "+(~a));                                 System.out.println("XOR operation : "+(a^b));                                 System.out.println("Right Shift : "+(a>>1));                                 System.out.println("Left Shift : "+(a<<1));                                 System.out.println("Zero Fill Right Shift : "+(a>>>1));                 }... Continue Reading →

Advertisements

Operator in java: –

Operator in java: - It is used to perform the operation over operands. The following are its type – Arithmetic operator: - Used to perform arithmetic operation. Ex: - +, -, *, / and % (modulus) Unary operator: - Used to perform operation on one operand. Ex: - -, ++, -- Assignment operator: - Used... Continue Reading →

Naming conventions (Style or pattern) in java: –

Naming conventions (Style or pattern) in java: - It is all about how we write the java program elements. Ex: - Name of package, class, interface, method, variable, symbolic constant, keyword etc. Package is sub directory / sub folder in which the relevant classes and interfaces are available in compressed form. It must be written... Continue Reading →

Write a first java program to print a string?

import java.lang.*;          //Built-in package public class First {                 public static void main(String arg[])                 {                                 System.out.println("Hello Student !!!");                 } } First.main(): - This done by JVM automatically when calling to main(). (Became main is a static method) To compile: -                 Javac First.java To execute: -                 Java First

Introduction to first java program: –

Introduction to first java program: - The file must be saved with (.java) extension. We can use any editor to write java program. Ex: - Text editor, any IDE (Integrated Development Environment) (Eclipse, NetBeans etc.) To compile and run the java program, we can also perform on DOS command prompt or in any IDE. To... Continue Reading →

JVM (JAVA Virtual Machine): –

 JVM (JAVA Virtual Machine): - It is a virtual computer which resides inside JRE. JRE is JAVA runtime environment where all runtime supported libraries files one kept. When we install JDK (JAVA development kit) to get all necessary tools required for JAVA program development then JRE will also be installed automatically. The purpose of JVM... Continue Reading →

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: