You are on page 1of 10

host-197-096:~ Darshil$ cd coding

host-197-096:coding Darshil$ cd java


host-197-096:java Darshil$ vi hellorusty.java
host-197-096:java Darshil$ javac hellorusty.java
host-197-096:java Darshil$ java hellorusty
hellowhoever you are
host-197-096:java Darshil$ java hellorusty d
hellod
host-197-096:java Darshil$ vi hellorusty.java
host-197-096:java Darshil$ vi hellorusty.java
host-197-096:java Darshil$ java hellorusty d
hellod
host-197-096:java Darshil$ javac hellorusty.java
host-197-096:java Darshil$ java hellorusty d
hello d
host-197-096:java Darshil$ vi hellorusty.java
host-197-096:java Darshil$ java hellorusty d
hello d
host-197-096:java Darshil$ javac hellorusty.java
host-197-096:java Darshil$ java hellorusty d
hello d
host-197-096:java Darshil$ java hellorusty
hello whoever you are
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
hello.java:6: ';' expected
if(args.length == 0)
^
hello.java:33: '}' expected
^
2 errors
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
hello.java:33: '}' expected
^
1 error
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello
hello Whoever you are
host-197-096:java Darshil$ java hello dara adfs afsdf
hello dara adfs afsdf
host-197-096:java Darshil$ java hello adfs fsdfsd dfsd f sdfs
hello all the rest
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
hello.java:14: cannot find symbol
symbol : variable n
location: class hello
System.out.println(args[n]);
^
hello.java:15: cannot find symbol
symbol : variable n
location: class hello
n++;
^
2 errors
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
hello.java:14: cannot find symbol
symbol : variable n
location: class hello
System.out.println(args[n]);
^
hello.java:15: cannot find symbol
symbol : variable n
location: class hello
n =n + 1;
^
hello.java:15: cannot find symbol
symbol : variable n
location: class hello
n =n + 1;
^
3 errors
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
hello.java:15: variable n might not have been initialized
System.out.println(args[n]);
^
1 error
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
hello.java:9: variable n might not have been initialized
if(args.length < n)
^
1 error
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads
hello da
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello da
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello da
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello da
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ java hello
hello Whoever you are
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello da
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello da
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello da
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello was
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello was
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello da
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello da
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads sdfds sdfsd
hello da
dads
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads
hello dadadsException in thread "main" java.lang.ArrayIndexOutOfBoundsException:
2
at hello.main(hello.java:13)
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads
hello da host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads fsdfs fsdd
hello da host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads fsdfs fsdd
hello da host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads fsdfs fsdd
hello da host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ vi hello.java
host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ java hello da dads fsdfs fsdd
hello dads host-197-096:java Darshil$ javac hello.java
host-197-096:java Darshil$ clear
host-197-096:java Darshil$ vi for.java
host-197-096:java Darshil$ javac for.java
for.java:1: <identifier> expected
class for
^
for.java:15: '{' expected
^
2 errors
host-197-096:java Darshil$ vi for.java
host-197-096:java Darshil$ javac for.java
for.java:15: '}' expected
^
1 error
host-197-096:java Darshil$ vi for.java
host-197-096:java Darshil$ javac for.java
host-197-096:java Darshil$ java for
Exception in thread "main" java.lang.NoClassDefFoundError: for
host-197-096:java Darshil$ javac forloop.java
host-197-096:java Darshil$ java forloop
hello
host-197-096:java Darshil$ java forloop afd
helloafd
host-197-096:java Darshil$ java forloop afdf fsdf dfsd fdfsd fsdf dfsdffsdfd
helloafdf fsdf dfsd fdfsd fsdf dfsdffsdfd
host-197-096:java Darshil$ clear
host-197-096:java Darshil$ vi hellogoodbye.java
host-197-096:java Darshil$ javac hellogoodbye.java
hellogoodbye.java:11: <identifier> expected
public stativ void main(String args[])
^
hellogoodbye.java:15: ';' expected
}
^
2 errors
host-197-096:java Darshil$ vi hellogoodbye.java
host-197-096:java Darshil$ javac hellogoodbye.java
host-197-096:java Darshil$ java Helloworad
Exception in thread "main" java.lang.NoClassDefFoundError: Helloworad
host-197-096:java Darshil$ java Helloworld
hello world
host-197-096:java Darshil$ java Goodbyeworld
goodbye cruel world
host-197-096:java Darshil$
host-197-096:java Darshil$ clear

host-197-096:java Darshil$ class Fahrtocelsius


-bash: class: command not found
host-197-096:java Darshil$ vi temperature.java
host-197-096:java Darshil$ javac temperature.java
temperature.java:10: cannot find symbol
symbol : variable set
location: class fahrtocelsius
set=20.0;
^
1 error
host-197-096:java Darshil$ vi temperature.java
host-197-096:java Darshil$ javac temperature.java
host-197-096:java Darshil$ java temperature
Exception in thread "main" java.lang.NoClassDefFoundError: temperature
host-197-096:java Darshil$ java temperature
Exception in thread "main" java.lang.NoClassDefFoundError: temperature
host-197-096:java Darshil$ java temperature
Exception in thread "main" java.lang.NoClassDefFoundError: temperature
host-197-096:java Darshil$ java temperature
Exception in thread "main" java.lang.NoClassDefFoundError: temperature
host-197-096:java Darshil$ java temperature
Exception in thread "main" java.lang.NoClassDefFoundError: temperature
host-197-096:java Darshil$ java temperature
Exception in thread "main" java.lang.NoClassDefFoundError: temperature
host-197-096:java Darshil$ vi temperature.java
host-197-096:java Darshil$ java temperature.java [A
Exception in thread "main" java.lang.NoClassDefFoundError: temperature/java
host-197-096:java Darshil$ javac temperature.java
host-197-096:java Darshil$ java temperature
0.0 -17.7777777777777820.0 -6.66666666666666740.0 4.44444444444444560.0 15.55555
555555555580.0 26.666666666666668100.0 37.77777777777778120.0 48.888888888888886
140.0 60.0160.0 71.11111111111111180.0 82.22222222222223200.0 93.333333333333332
20.0 104.44444444444444240.0 115.55555555555556260.0 126.66666666666667280.0 137
.77777777777777300.0 148.88888888888889host-197-096:java Darshil$ clear
host-197-096:java Darshil$ vi temperature.java
host-197-096:java Darshil$ javac temperature.java
temperature.java:8: possible loss of precision
found : double
required: int
lower=0.0;
^
temperature.java:9: possible loss of precision
found : double
required: int
upper=300.0;
^
temperature.java:10: possible loss of precision
found : double
required: int
step=20.0;
^
3 errors
host-197-096:java Darshil$ vi temperature.java
host-197-096:java Darshil$ javac temperature.java
host-197-096:java Darshil$ java temperature
0 -1720 -640 460 1580 26100 37120 48140 60160 71180 82200 93220 104240 115260 12
6280 137300 148host-197-096:java Darshil$ clear
host-197-096:java Darshil$ vi factorial.java
host-197-096:java Darshil$ vi factorial.java
host-197-096:java Darshil$ javac factorial.java
factorial.java:12: variable n might not have been initialized
System.out.println(factorial(n));
^
factorial.java:25: missing return statement
}
^
2 errors
host-197-096:java Darshil$ vi factorial.java
host-197-096:java Darshil$ javac factorial.java
factorial.java:25: cannot find symbol
symbol : variable results
location: class Factorial
return results;
^
1 error
host-197-096:java Darshil$ vi factorial.java
host-197-096:java Darshil$ javac factorial.java
host-197-096:java Darshil$ java Factorial
1
2
6
24
120
720
5040
40320
362880
3628800
host-197-096:java Darshil$ clear
host-197-096:java Darshil$ vi counting.java
host-197-096:java Darshil$ javac counting.java
counting.java:15: cannot find symbol
symbol : variable ndigit
location: class randomtest
ndigit[i] = 0;
^
counting.java:20: cannot find symbol
symbol : method NextDouble()
location: class java.util.Random
x=myrandom.NextDouble()*10.0;
^
counting.java:27: cannot find symbol
symbol : variable ndigit
location: class randomtest
System.out.println(i+": "+ ndigit[i]);
^
3 errors
host-197-096:java Darshil$ vi factorial.java
host-197-096:java Darshil$ vi counting.java
host-197-096:java Darshil$ vi factorial.java
host-197-096:java Darshil$ javac counting.java
counting.java:20: cannot find symbol
symbol : method NextDouble()
location: class java.util.Random
x=myrandom.NextDouble()*10.0;
^
1 error
host-197-096:java Darshil$ vi factorial.java
host-197-096:java Darshil$ vi counting.java
host-197-096:java Darshil$ javac counting.java
counting.java:20: cannot find symbol
symbol : method NextDouble()
location: class java.util.Random
x=myrandom.NextDouble() * 10.0;
^
1 error
host-197-096:java Darshil$ vi counting.java
host-197-096:java Darshil$ javac counting.java
host-197-096:java Darshil$ vi counting.java
host-197-096:java Darshil$ java randomtest
0: 9972
1: 10004
2: 10100
3: 9935
4: 10047
5: 9904
6: 10101
7: 9907
8: 10003
9: 10027
host-197-096:java Darshil$ vi counting.java
host-197-096:java Darshil$ vi array.java
host-197-096:java Darshil$ javac array.java
host-197-096:java Darshil$ java fillarray
host-197-096:java Darshil$ vi bubble_sort.java
host-197-096:java Darshil$ javac bubble_sort.java
bubble_sort.java:6: ';' expected
^
bubble_sort.java:8: <identifier> expected
n=new int[10];
^
bubble_sort.java:11: illegal start of type
for(int i=0;i<10;i++)
^
bubble_sort.java:15: <identifier> expected
System.out.println("Before sorting");
^
bubble_sort.java:16: illegal start of type
for(int i=0;i<10;i++)
^
bubble_sort.java:21: <identifier> expected
boolean sorted=false;
^
bubble_sort.java:23: illegal start of type
while(!sorted)
^
bubble_sort.java:37: <identifier> expected
System.out.println();
^
bubble_sort.java:38: <identifier> expected
System.out.println("after sorting");
^
bubble_sort.java:40: illegal start of type
for(int i=0;i<10;i++)
^
bubble_sort.java:44: <identifier> expected
}
^
bubble_sort.java:45: 'class' or 'interface' expected
}
^
bubble_sort.java:46: 'class' or 'interface' expected
^
13 errors
host-197-096:java Darshil$ vi bubble_sort.java
host-197-096:java Darshil$ javac bubble_sort.java
bubble_sort.java:6: ';' expected
^
bubble_sort.java:8: <identifier> expected
n=new int[10];
^
bubble_sort.java:11: illegal start of type
for(int i=0;i<10;i++)
^
bubble_sort.java:15: <identifier> expected
System.out.println("Before sorting");
^
bubble_sort.java:16: illegal start of type
for(int i=0;i<10;i++)
^
bubble_sort.java:21: <identifier> expected
boolean sorted=false;
^
bubble_sort.java:23: illegal start of type
while(!sorted)
^
bubble_sort.java:37: <identifier> expected
System.out.println();
^
bubble_sort.java:38: <identifier> expected
System.out.println("after sorting");
^
bubble_sort.java:40: illegal start of type
for(int i=0;i<10;i++)
^
bubble_sort.java:44: <identifier> expected
}
^
bubble_sort.java:45: 'class' or 'interface' expected
}
^
bubble_sort.java:46: 'class' or 'interface' expected
^
13 errors
host-197-096:java Darshil$ vi bubble_sort.java
host-197-096:java Darshil$ javac bubble_sort.java
bubble_sort.java:18: ')' expected
System.out.println("n["i++"] = " n[i]);
^
bubble_sort.java:42: ')' expected
System.out.println("n["++i"]="+n[i]);
^
2 errors
host-197-096:java Darshil$ vi bubble_sort.java
host-197-096:java Darshil$ javac bubble_sort.java
bubble_sort.java:18: ')' expected
System.out.println("n["+i+"] = " n[i]);
^
1 error
host-197-096:java Darshil$ vi bubble_sort.java
host-197-096:java Darshil$ javac bubble_sort.java
host-197-096:java Darshil$ java bubblesort
Exception in thread "main" java.lang.NoClassDefFoundError: bubblesort (wrong nam
e: Bubblesort)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
host-197-096:java Darshil$ vi bubble_sort.java
host-197-096:java Darshil$ javac bubble_sort.java
host-197-096:java Darshil$ vi bubble_sort.java
host-197-096:java Darshil$ java Bubblesort
Before sorting
n[0] = -1446497271
n[1] = 410631197
n[2] = -1268095117
n[3] = 1248512854
n[4] = -562394541
n[5] = -1158693379
n[6] = 1940815750
n[7] = -2127571444
n[8] = 285962168
n[9] = 2115931179
after sorting
n[0]=-2127571444
n[1]=-1446497271
n[2]=-1268095117
n[3]=-1158693379
n[4]=-562394541
n[5]=285962168
n[6]=410631197
n[7]=1248512854
n[8]=1940815750
n[9]=2115931179
host-197-096:java Darshil$ vi hello_exception.java
host-197-096:java Darshil$ java hello_exception.java
Exception in thread "main" java.lang.NoClassDefFoundError: hello_exception/java
host-197-096:java Darshil$ javac hello_exception.java
hello_exception.java:9: '(' expected
{
^
hello_exception.java:12: <identifier> expected
}
^
hello_exception.java:14: '}' expected
^
3 errors
host-197-096:java Darshil$ vi hello_exception.java
host-197-096:java Darshil$ javac hello_exception.java
host-197-096:java Darshil$ vi hello_exception.java
host-197-096:java Darshil$ java helloexception
hello whoever you are
host-197-096:java Darshil$ java helloexception darshil
Hello darshil
host-197-096:java Darshil$ vi file.java
host-197-096:java Darshil$ javac file.java
host-197-096:java Darshil$ java filehello
what is your name
afsdfsdfsfsadfsdjfnsd
helloafsdfsdfsfsadfsdjfnsd
host-197-096:java Darshil$ java filehello
what is your name
sfdf sfds
hellosfdf sfds
host-197-096:java Darshil$ fsd
-bash: fsd: command not found
host-197-096:java Darshil$ java filehello
what is your name
hello
host-197-096:java Darshil$ java filehello
what is your name
3
hello3
host-197-096:java Darshil$ java filehello
what is your name
a

You might also like