0% found this document useful (0 votes)
42 views4 pages

Debugging Assignment 2 PDF

The document contains multiple Java programs demonstrating various features such as variable declaration, loops, and character manipulation. Each program is structured to print specific outputs, including integers, bytes, and characters. The examples illustrate basic programming concepts and syntax in Java.

Uploaded by

lokeshsm4848
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views4 pages

Debugging Assignment 2 PDF

The document contains multiple Java programs demonstrating various features such as variable declaration, loops, and character manipulation. Each program is structured to print specific outputs, including integers, bytes, and characters. The examples illustrate basic programming concepts and syntax in Java.

Uploaded by

lokeshsm4848
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Program 11

public class Program {

public static void main(String args[]) {


int t=10;
System.out.println(t);
}}

Program 12

public class Program {

public static void main(String[] args) {


for(int i = 0;i<=1; i++)
{
System.out.println("Hello");
break;
}
}
}

Program 13

public class Program {

public static void main(String[] args) {


byte $a = 126;
System.out.println($a);
}
}
Program 14
public class Program {

public static void main(String[] args) {


byte a = 126;
System.out.println(a);
}
}

Program 15
public class Program {

public static void main(String[] args) {


byte a = 126;
System.out.println(a);
}
}

Program 16
public class Program {

public static void main(String[] args) {


int a = 0;
a++;
System.out.println(a);
}
}
Program 17
public class Program {

public static void main(String[] args) {


byte myByte1,myByte2;
myByte1 = 127;
myByte2 = -48;
System.out.println("Byte 1: " +myByte1);
System.out.println("Byte 2: " +myByte2);
myByte1++; // Looping back within the range
System.out.println("Incremented Value of myByte1:
" +myByte1);
}
}

Program 18
public class Program {

public static void main(String[] args) {


byte myByte1,myByte2;
myByte1 = 127;
myByte2 = -48;
System.out.println("Byte 1: " +myByte1);
System.out.println("Byte 2: " +myByte2);
myByte1++; // Looping back within the range
System.out.println("Incremented Value of myByte1: "
+myByte1);
}
}

Program 19
public class Program
public static void main(String[] args) {
byte myByte1,myByte2;
myByte1 = 127;
myByte2 = -48;
System.out.println("Byte 1: " +myByte1);
System.out.println("Byte 2: " +myByte2);
myByte1++; // Looping back within the range
System.out.println("Incremented Value of myByte1:
"
+myByte1);
}
}

Program 20
public class Program {

public static void main(String[] args) {

char myChar1 = 'A';


char myChar2 = 'B';
System.out.println("myChar1: " +myChar1);
System.out.println("myChar2: " +myChar2);
myChar2++; // valid increment operation
System.out.println("The Incremented value of
myChar2: "
+myChar2);
}
}

You might also like