Question

In: Computer Science

Print "Hello World" in the most complicated way (java)

Print "Hello World" in the most complicated way (java)

Solutions

Expert Solution

Solution

Screenshot

Code

class HelloText implements Runnable
{
public void run(){
char l = ' ';
char[] h = new char[6];
int o = 0, m = 0, n = 0;
int[] k = {104, 101, 108, 108, 111, 32};
for (int i = h.length-1; i > -1; i--){
h[i] = (char) k[o++];
System.out.print(h[i]);
}
}
}

class WorldText implements Runnable
{
public void run()
{
int k = 100;
char kkkkkk = (char) 100+10+9;
char kkkkk = (char) 3*((2*15)+7);
char kkkk = (char) Math.sqrt(12996);
char kkk = (char) 0+(-1)+108+(1)*1;
char kk = (char) k;
  
System.out.println(kkkkkk+""+kkkkk+kkkk+kkk+kk);
}
static int excla(){
int i = (int) Math.pow(3,3)+6;
return i;
}
}
public class Main
{
public static void main(String[] args)
{
Thread worldt = new Thread(new HelloText());
Thread hellot = new Thread(new WorldText());
try
{
worldt.start();
worldt.join();
hellot.start();
hellot.join();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}

Output

---

all the best


Related Solutions

Modify the following source code so that five subsequent threads print the message “Hello World number,”...
Modify the following source code so that five subsequent threads print the message “Hello World number,” where number indicates the unique thread created; e.g. “Hello World 1” // Your_name_goes_here #include <pthread.h> #include <semaphore.h> sem_t semaphore; // also a global variable just like mutexes void *thread_function( void *arg ) { sem_wait( &semaphore ); // perform some task pthread_exit( NULL ); } int main() { int tmp; tmp = sem_init( &semaphore, 0, 0 ); // initialize pthread_create( &thread[i], NULL, thread_function, NULL );...
C++: How are std::cout << “hello world” and std::cout << “hello” << ‘ ‘ << “world”...
C++: How are std::cout << “hello world” and std::cout << “hello” << ‘ ‘ << “world” different?
Convert "hello world" into hex "hello world" in hex = 68656c6c6f20776f726c64 encrypt the above binary content...
Convert "hello world" into hex "hello world" in hex = 68656c6c6f20776f726c64 encrypt the above binary content with a 4 bit block cipher whose codebook consists of 6, 0, 13, 4, 3, 1, 14, 8, 7, 12, 9, 15, 5, 2, 11, 10 (The codebook is simply the output blocks in the order of the integers corresponding to the 16 possible input blocks). What will the encrypted output be for this text?
hello please correct this code print("The Miles Per Gallon program") print() Trips = [] trip =...
hello please correct this code print("The Miles Per Gallon program") print() Trips = [] trip = 0 while 1: print("Do you want to add a trip from a csv file or Enter it manually? 1 for csv 2 for entering it manually") method = int(input()) if method == 1: print("Enter the filename") fileName = input() try: with open(fileName, 'r') as myFile1: reader = csv.reader(myFile1) Trips = list(reader) print("Miles Driven Gallons Used \tMPG") for i in Trips: for j in i:...
how to create file: vim hello<your name>.py print “Hello <your name>!” on ubuntu
how to create file: vim hello<your name>.py print “Hello <your name>!” on ubuntu
BOVOU PWN <?php echo Hello World!; 77
BOVOU PWN <?php echo Hello World!; 77
Psychotic disorders and schizophrenic disorders are some of the most complicated and challenging diagnoses in the...
Psychotic disorders and schizophrenic disorders are some of the most complicated and challenging diagnoses in the DSM. The symptoms of psychotic disorders may appear quite vivid in some clients; whereas, within other clients, symptoms may be barely observable. Additionally, symptoms may overlap among disorders. For example, specific symptoms such as neurocognitive impairments, social problems, and illusions may exist in schizophrenic clients, but are also contributing symptoms for other psychotic disorders. For this Discussion, consider whether experiences of psychosis-related symptoms are...
Hello, ***We have to print the second list backward while interleaved with the first list in...
Hello, ***We have to print the second list backward while interleaved with the first list in normal order.*** its PYTHON language. Please refer the below example. Bold are the inputs that the user enters. In here the user input words and much as he wants and when he enter STOP, it stops and he is asked to enter more words.(second words count equals to the word count he inputs in the first phase) Enter words, STOP to stop. Ok Enter...
Using the software Emulator EMU8086, write an assembly program that uses a loop to print "HELLO...
Using the software Emulator EMU8086, write an assembly program that uses a loop to print "HELLO WORLD" 3 times and "LIFE" 2 times. Example: HELLO WORLD HELLO WORLD HELLO WORLD LIFE LIFE   
I NEED IT PRINT IN THIS FORM JAVA How is a Java source file executed? 1....
I NEED IT PRINT IN THIS FORM JAVA How is a Java source file executed? 1. It is compiled and runs natively 2. It is interpreted but not compiled 3. It is compiled into byte code and executed by the Java Virtual Machine 4. It is magic Please enter your answer 1 Sorry that answer is not correct. The correct answer is 3 Correct output: How is a Java source file executed? 1. It is compiled and runs natively 2....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT