0

Do we need to put termination mark after creating a separate class for a java program?

for e.g public myclass{ statement1; statement 2; ..... }; the last termination mark is necessary or not. I'm confused because it gets compiled in both the cases. please explain, new to the language.

13th Jul 2017, 11:12 AM
Akashdeep Nandi
Akashdeep Nandi - avatar
6 Answers
+ 2
nope bro it isn't needed in java . There's no need for termination mark (semi colon ) after any }
13th Jul 2017, 11:13 AM
Nirmal Kumar Bhakat
Nirmal Kumar Bhakat - avatar
+ 2
yup its needed in c++
13th Jul 2017, 11:14 AM
Nirmal Kumar Bhakat
Nirmal Kumar Bhakat - avatar
+ 1
It was the same problem for me when i started C++ (as i had learnt java earlier). But you need to practice and keep in mind small parts of both the languages . You'll get used to it soon as u do further . If u know one language that doesn't mean u'll not practice that keep doing both simultaneously applying a program to both the languges and u'll see the results soon.
13th Jul 2017, 11:20 AM
Nirmal Kumar Bhakat
Nirmal Kumar Bhakat - avatar
+ 1
thank you guys it really helped.
13th Jul 2017, 11:23 AM
Akashdeep Nandi
Akashdeep Nandi - avatar
0
and for c++?
13th Jul 2017, 11:14 AM
Akashdeep Nandi
Akashdeep Nandi - avatar
0
I'm getting my languages mixed up like. i have learnt c++,c now I'm trying java. any suggestion you have to keep things sorted ?
13th Jul 2017, 11:16 AM
Akashdeep Nandi
Akashdeep Nandi - avatar