56 lines
3.6 KiB
HTML
56 lines
3.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<title>EscapeSequencesAndUnicode.java</title>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<style type="text/css">
|
|
<!--
|
|
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
|
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
|
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
|
.string {color: #6a8759}
|
|
.number {color: #6897bb}
|
|
.comment {color: #808080}
|
|
.whitespace {color: #505050}
|
|
.literal {color: #cc7832}
|
|
-->
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Assignments/Lab10_CalebFontenot/src/lab10_calebfontenot/EscapeSequencesAndUnicode.java</td></tr></table>
|
|
<pre>
|
|
<span class="comment">/*</span>
|
|
<span class="comment"> * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license</span>
|
|
<span class="comment"> * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template</span>
|
|
<span class="comment"> */</span>
|
|
<span class="literal">package</span> lab10_calebfontenot;
|
|
|
|
<span class="comment">/**</span>
|
|
<span class="comment"> *</span>
|
|
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
|
<span class="comment">*/</span>
|
|
<span class="literal">public</span> <span class="literal">class</span> EscapeSequencesAndUnicode {
|
|
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> main(String[] args) {
|
|
|
|
System.out.println(<span class="string">"</span><span class="string">I delete the last 3 characterssss</span><span class="literal">\b</span><span class="literal">\b</span><span class="literal">\b</span><span class="string">"</span>);
|
|
System.out.println(<span class="string">"</span><span class="literal">\t</span><span class="literal">\t</span><span class="string">I used 2 tabs here</span><span class="string">"</span>);
|
|
System.out.println(<span class="string">"</span><span class="string">I printed a </span><span class="literal">\"</span><span class="string"> inside quotes</span><span class="string">"</span>);
|
|
|
|
<span class="literal">char</span> b = <span class="string">'</span><span class="string">b</span><span class="string">'</span>;
|
|
<span class="literal">char</span> bCapital = <span class="number">66</span>;
|
|
<span class="literal">char</span> a = <span class="string">'</span><span class="string">\u0061</span><span class="string">'</span>; <span class="comment">//16 * 6 + 1 = 96 in decimal</span>
|
|
<span class="literal">char</span> aCapital = <span class="number">0x41</span>;
|
|
<span class="literal">char</span> greekAlpha = <span class="string">'</span><span class="string">\u03b1</span><span class="string">'</span>; <span class="comment">// 3 x 256 + 11 x 16 + 1 = ? in decimal</span>
|
|
|
|
System.out.println(<span class="string">"</span><span class="string">I print in latin and in greek ---> </span><span class="string">"</span>+
|
|
+ b + <span class="string">"</span> <span class="string">"</span>
|
|
+ bCapital + <span class="string">"</span> <span class="string">"</span>
|
|
+ aCapital + <span class="string">"</span> <span class="string">"</span>
|
|
+ a + <span class="string">"</span> <span class="string">"</span>
|
|
+ greekAlpha );
|
|
}
|
|
}
|
|
|
|
</pre></body>
|
|
</html>
|