Sakshi Ghosh

Sakshi Ghosh

7 Articles Published

Articles by Sakshi Ghosh

7 articles

Java Program to Illustrate Use of Binary Literals

Sakshi Ghosh
Sakshi Ghosh
Updated on 28-Jan-2025 630 Views

In this article, we will learn to illustrate the use of binary literals in Java. This feature is particularly useful when working with low-level data manipulation, such as in embedded systems or when dealing with bitwise operations. What is Binary Literal? A binary literal is a number that is denoted using binary digits that are 0s and 1s. The values written in data types – byte, int, long, and short can be easily expressed in a binary number system. The prefix 0b or 0B is added to the integer to declare a binary literal. For example − ...

Read More

Java Program to illustrate Total Marks and Percentage Calculation

Sakshi Ghosh
Sakshi Ghosh
Updated on 09-Jul-2024 5K+ Views

We will demonstrate how total marks and percentages are calculated using Java programs. The term total marks refer to the summation of all the available marks, while the term percentage refers to the number obtained by dividing the calculated marks by total marks and multiplying the resultant by 100. percentage_of_marks = (obtained_marks/total_marks) × 100 Problem Statement Given a Java program to calculate the total marks and percentage of a student in a given set of subject. Input marks = { 69, 88, 77, 89, 98, 100, 57, 78 } Output Total Marks is: 656 Total Percentage is: ...

Read More

Java Program to Illustrates Use of Static Inner Class

Sakshi Ghosh
Sakshi Ghosh
Updated on 11-Aug-2023 270 Views

Here, we will demonstrate the usage of static inner class using the Java program. Before diving deep into the topic, let us get acquainted with the term Static Inner Class . Static Inner Class An inner class is the one, which is defined within another class. A Static Inner Class is a nested class that is a static member of the outer class. Other static members can be used to access it without first instantiating the outer class. A static nested class lacks access to the instance variables and methods of the outer class, much like static member’s java. Example ...

Read More

Java Program to illustrate the Usage of Hexadecimal

Sakshi Ghosh
Sakshi Ghosh
Updated on 11-Aug-2023 419 Views

Here, the usage of Hexadecimal shall be demonstrated through the Java Program. Let us get acquainted with the term Hexadecimal before seeing a Java program. The Hexadecimal is a type of number system that has a base value of 16. There are 16 symbols representing hexadecimal numbers. These symbols or values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. Each digit represents a decimal value.  The hexadecimal numbers from 0 to 9 are equivalent to decimal numbers from 0 to 9. Further, A represents 10, B represents 11, C represents ...

Read More

Java Program to Illustrate the Availability of Default Constructor of the Super Class to the Sub Class by Default

Sakshi Ghosh
Sakshi Ghosh
Updated on 11-Aug-2023 206 Views

Here, we will demonstrate the availability of the default constructor of the super class to the sub class by default through Java Program. Before diving deep into the topic, let us get acquainted with the term Constructor, Super class, and subclass. Constructor A special method in Java is considered for the initialization of an object. The name of the constructor is the same as the class name and it does not return anything. A default constructor is invoked by itself whenever an object is created using a new keyword. There are following three types of constructors in Java ...

Read More

Java Program to Illustrate the usage of Octal Integer

Sakshi Ghosh
Sakshi Ghosh
Updated on 12-Apr-2023 296 Views

Octal Integer is a number system having a base of 8 and digits from 0 to 7. Int data type is taken into account to store an octal number. The usage of the Octal number system is to be discussed here − Converting decimal to Octal Converting octal to decimal. Conversion from a Decimal number system to an Octal Number system Basics of Conversion To convert any decimal number into its equivalent octal number: Keep dividing the decimal number by the base of the octal number system which is 8 till the quotient 0 is received. Remember ...

Read More

Java Program to Illustrate a Method with 2 Parameters and without Return Type

Sakshi Ghosh
Sakshi Ghosh
Updated on 11-Apr-2023 3K+ Views

A method without a return type is termed a void method since it returns nothing. This method can accept multiple parameters. In this tutorial, we will implement Java programs illustrating a method with two parameters and without return type. First of all, we are going to get acquainted with the syntax, examples, and, finally implementation. Syntax public static void method_name (int parameter1, int parameter2) Here, public − It is the access specifier specifying who can access this method. static − It is mandatory to make the method static to avoid errors. void − it denotes that this method returns ...

Read More
Showing 1–7 of 7 articles
« Prev 1 Next »
Advertisements