How to convert A to a and a to A using AND and OR in Java

Create a program that allows you to display lowercase letters a to A or a to A using the ASCII character code.

public class Alphabet{ public static void main(String args[]) char a = 'a'; int y = 0; int z = 0; y = (char)a; z = y & Oxdf; // Find the bitwise AND System.out.println((char)z); //Aが表示される


z = y | 0x20; // Find the bitwise OR System.out.println ((char) z); // a is displayed.

Recommended Posts

How to convert A to a and a to A using AND and OR in Java
How to convert a file to a byte array in Java
How to develop and register a Sota app in Java
[Android] Convert Map to JSON using GSON in Kotlin and Java
How to display a web page in Java
How to convert a solidity contract to a Java contract class
How to test a private method in Java and partially mock that method
How to convert Java radix
Convert JSON and YAML in Java (using Jackson and SnakeYAML)
How to create a Java environment in just 3 seconds
How to create a data URI (base64) in Java
How to ZIP a JAVA CSV file and manage it in a Byte array
How to make a Java container
How to learn JAVA in 7 days
[Java] How to create a folder
How to convert LocalDate and Timestamp
How to use classes in Java?
How to name variables in Java
How to make a Java array
How to concatenate strings in java
Convert a Java byte array to a string in hexadecimal notation
[Java] How to convert a character string from String type to byte type
How to store a string from ArrayList to String in Java (Personal)
How to call and use API in Java (Spring Boot)
I tried to convert a string to a LocalDate type in Java
How to simulate uploading a post-object form to OSS in Java
Differences in how to handle strings between Java and Perl
How to join a table without using DBFlute and sql
A memo about the types of Java O/R mappers and how to select them
How to implement a circular profile image in Rails using CarrierWave and R Magick
How to execute a contract using web3j
How to sort a List using Comparator
How to make a Java calendar Summary
How to implement date calculation in Java
How to implement Kalman filter in Java
Multilingual Locale in Java How to use Locale
How to insert a video in Rails
How to POST JSON in Java-Method using OkHttp3 and method using HttpUrlConnection-
[Java] How to calculate age using LocalDate
How to implement a job that uses Java API in JobScheduler
How to create a new Gradle + Java + Jar project in Intellij 2016.03
How to do base conversion in Java
[Introduction to Java] How to write a Java program
How to automatically operate a screen created in Java on Windows
How to remote debug Java 9 or later
[Java] How to output and write files!
How to make a Discord bot (Java)
Convert SVG files to PNG files in Java
How to implement coding conventions in Java
How to get the date in java
How to solve the unknown error when using slf4j in Java
How to publish a library in jCenter
[Java] How to convert from String to Path type and get the path
How to make a groundbreaking diamond using Java for statement wwww
Java to C and C to Java in Android Studio
How to encrypt and decrypt with RSA public key in Java
[Java] How to search for a value in an array (or list) with the contains method
How to implement a slideshow using slick in Rails (one by one & multiple by one)
How to create a query using variables in GraphQL [Using Ruby on Rails]
[Personal memo] How to interact with a random number generator in Java
Creating a project (and GitHub repository) using Java and Gradle in IntelliJ IDEA